-
Notifications
You must be signed in to change notification settings - Fork 18.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambiguous error message when creating a container with more than one network #44613
Comments
The documentation is quite explicit, actually. You make a good point about the quality of the error message, though. @thaJeztah do you remember why the decision was made to disable the ability to create a container with more than one network attached? #19560 only says "to avoid confusion it was recommended to disable it." |
Thanks for pointing that out. It seems like it could be moved earlier. I would not expect to find this information under the heading "IP address and hostname". What about in the documentation for (It is very reasonable to assume that, absent information to the contrary in the documentation for Also for what it's worth if you search the docs with the built-in search widget for the phrase "multiple networks" the page you linked is not within the first page of results, so it's a little hard to find through search. |
Thanks for the ping; yes the error message could use some tweaking, but (story-telling time!): TL;DRvery likely multiple networks can be supported on The long answer as to "why multiple networks on container create are currently not supported";Originally, there was only 1 network (the default "bridge" network), but the When custom networks were added, the existing Now that custom networks were possible; the (obvious) question was "why not allow attaching to multiple networks on More options were added, such as Fast-forward some time; more options were needed for networks, and a PR was opened to add a
So, I wrote up a proposal for an alternative UX; #31964 - while this wouldn't fix the problem, it at least would not paint ourselves further into a corner. This syntax was implemented for Swarm services (docker/cli#62). The equivalent for On that PR, the "single network" restriction was removed from the CLI, delegating the validation to the daemon (API); this was from my estimation that the API should be able to support multiple networks, but further investigating was needed to confirm that, and as it was getting close to a release, I kept the "single network only" validation in place on the daemon side docker/cli#1767 (comment)
This should definitely be looked into, as it would also simplify how |
|
Description
The documentation is unclear on whether multiple networks can be specified when executing
docker run
.There are old issues like this one that claim a container can only be started with one network, or this StackOverflow question whose answer links to a no-longer-existent page on docker.com that says "Docker only allows a single network to be specified with the docker run command."
Is this still the case? The documentation is silent on the topic, and the error messages leave it ambiguous.
Reproduce
Expected behavior
The error message and documentation should be clear about whether multiple networks are supported.
If multiple networks are not supported, and I pass multiple
--network
flags, please display a concise error message like "Only one network can be specified when starting a container. Additional networks can be attached later withdocker network connect
."If multiple networks are supported, this must have been a change in the last few years. Some sentence about this in the documentation confirming which version this was supported in would be useful.
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: