github.com/robertojrojas/docker@v1.9.1/man/docker-network-connect.1.md (about)

     1  % DOCKER(1) Docker User Manuals
     2  % Docker Community
     3  % OCT 2015
     4  # NAME
     5  docker-network-connect - connect a container to a network
     6  
     7  # SYNOPSIS
     8  **docker network connect NAME CONTAINER**
     9  
    10  [**--help**]
    11  
    12  # DESCRIPTION
    13  
    14  Connects a running container to a network. You can connect a container by name
    15  or by ID. Once connected, the container can communicate with other containers in
    16  the same network.
    17  
    18  ```bash
    19  $ docker network connect multi-host-network container1
    20  ```
    21  
    22  You can also use the `docker run --net=<network-name>` option to start a container and immediately connect it to a network.
    23  
    24  ```bash
    25  $ docker run -itd --net=multi-host-network busybox
    26  ```
    27  
    28  You can pause, restart, and stop containers that are connected to a network.
    29  Paused containers remain connected and a revealed by a `network inspect`. When
    30  the container is stopped, it does not appear on the network until you restart
    31  it. The container's IP address is not guaranteed to remain the same when a
    32  stopped container rejoins the network.
    33  
    34  To verify the container is connected, use the `docker network inspect` command. Use `docker network disconnect` to remove a container from the network.
    35  
    36  Once connected in network, containers can communicate using only another
    37  container's IP address or name. For `overlay` networks or custom plugins that
    38  support multi-host connectivity, containers connected to the same multi-host
    39  network but launched from different Engines can also communicate in this way.
    40  
    41  You can connect a container to one or more networks. The networks need not be the same type. For example, you can connect a single container bridge and overlay networks.
    42  
    43  
    44  # OPTIONS
    45  **NAME**
    46    Specify network driver name
    47  
    48  **CONTAINER**
    49    Specify container name
    50  
    51  **--help**
    52    Print usage statement
    53  
    54  # HISTORY
    55  OCT 2015, created by Mary Anthony <mary@docker.com>