Skip to content

Feature request for docker run: Ability to connect to multiple networks #2455

@felixb95

Description

@felixb95

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 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.

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