Skip to content

--link should be disallowed with --net=container #9340

@gdm85

Description

@gdm85

I am trying to understand and use the --net=container feature. When I use a command like this:

docker run -d --restart=no --cpu-shares=512 --link db:db -p 443 --net=container:other-web-app -v /etc/someVolume  --name=test-net-container base-image

I get this error:

2014/11/25 21:51:43 Error response from daemon: Cannot start container 1e02f12a2fdceb2f057f0cd58cf29ffe45790dc8ecae7be88456f79dccc58c7e: parent IP '' is invalid

I have not been able to find where this error is coming from (doesn't seem docker/libcontainer code), however it is my guess that you cannot link to a container when using --net=container mode. I got there by successfully running the same command without the --link option :

docker run -d --restart=no --cpu-shares=512 -p 443 --net=container:other-web-app -v /etc/someVolume  --name=test-net-container base-image

If I am not mistaken, shouldn't the --link option be disallowed (or at least a more explanatory error message given)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions