Start container with multiple network interfaces

With 1.9, is there a way to start a container directly with two or more network interfaces?

You can do it after the container is started with “docker network connect”, but it means the process is already running and might miss the creation of the new one.

  • Wercker crashes on MacOS with PANIC too many open files
  • Docker-compose Daemon mode logs
  • “Is your docker daemon up and running?” Problems with docker hello world tutorial on Linux
  • Docker config : Celery + RabbitMQ
  • Export RabbitMQ Docker image with vhost and queues
  • How do I obtain a nodes IP address in a swarm using docker remote API?
  • How to configure docker registry to make a priority to local registry when PULL?
  • ERROR: Version in “./docker-compose.yml” is unsupported. You might be seeing this error because you're using the wrong Compose file version
  • Xdebug (inside Docker container) ignoring XDEBUG_CONFIG environment variable
  • Docker hangs when starting jdubois/jhipster container in OS X
  • Elastic Beanstalk with multiple environments and URL routing between them
  • Jenkins deploying war file to tomcat docker container
  • 3 Solutions collect form web for “Start container with multiple network interfaces”

    This question is top doing a search regarding docker and multiple network interfaces. Although is not the required version in the question I leave here some info:

    With Docker 1.12+ it’s possible to add more than one network interface to a docker container, but it is needed to create the container first and then attach the second (and subsequence) network NICs prior to start the container:

    $ docker create --network=network1 --name container_name containerimage:latest
    $ docker network connect network2 container_name
    $ docker start container_name

    It is needed to create the networks first:

    $ docker network create --driver=bridge network1 --subnet=
    $ docker network create --driver=bridge network2 --subnet=

    Also, you can start the container attaching the dockerhost network interfaces by using the –network=host argument in docker run:

    $ docker run --net=host containerimage:latest

    As @gesellix answered, currently its not possible.

    You can find this issue under

    There are some pending improvements in this area.
    As I see from discussions – current idea is to create container (with docker create), attach networks (docker network connect) and then start (docker start).

    You can check reasoning in comments of

    UPD: #17750 is closed and will be available in 1.10

    No, this isn’t possible. The docs also show that the necessary command line option --net only accepts a single network name:

    Please also keep in mind that Docker 1.9 constantly updates the /etc/hosts file inside your containers, so that a running process cannot rely on the initial state of that file. The best way would be to make your process aware of updates, either through manually reading the /etc/hosts file or by querying a dns server. That way you wouldn’t have issues when the second network will be connected.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.