You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
most of my containers are connected to multiple networks. Unfortunately, I have to run docker run --net mynet-1 -d --name alpine alpine and then docker network connect mynet-2 alpine for each container because the CLI doesn't support connecting a container to multiple networks at once.
It would be great if I could specify multiple networks at once in a single run command.
docker run --net mynet-1 --net mynet-2 -d --name alpine alpine
Would this be possible to implement? --net mynet-1,mynet-2 would also be an option. It probably would be enough if the CLI called the API for connecting the container to the second network, just as if network connect had been executed.
The text was updated successfully, but these errors were encountered:
felixb95
changed the title
Feature request for docker run: Ability to connect to multiple containers
Feature request for docker run: Ability to connect to multiple networks
Apr 20, 2020
I would highly appreciate having such a feature included in Docker.
There is a use case I had yesterday, where I needed to set sysctl values for some network interfaces (e.g --sysctl net.ipv4.conf.eth1.rp_filter=0), however since eth1 did not exist after issuing the initial "docker run" command, I couldn't set this value for the particular interface ( And of course I wanted to avoid --privileged)
Were there any historic reasons or technical limitations why this feature wasn't included in the first place?
Hi,
most of my containers are connected to multiple networks. Unfortunately, I have to run
docker run --net mynet-1 -d --name alpine alpine
and thendocker network connect mynet-2 alpine
for each container because the CLI doesn't support connecting a container to multiple networks at once.It would be great if I could specify multiple networks at once in a single run command.
Would this be possible to implement?
--net mynet-1,mynet-2
would also be an option. It probably would be enough if the CLI called the API for connecting the container to the second network, just as ifnetwork connect
had been executed.The text was updated successfully, but these errors were encountered: