from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209586

userrating:


May 25th. 2007:
Words

486

Views

258592

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149883

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





DOCKER

Section: Docker User Manuals (1)
Updated: Jun 2025
Index Return to Main Contents

 

NAME

docke-networ-connect- Connect a container to a network

 

SYNOPSIS

docker network connect [OPTIONS] NETWORK CONTAINER

 

DESCRIPTION

Connects a container to a network. You can connect a container by name or by ID. Once connected, the container can communicate with other containers in the same network.

$ docker network connect mult-hos-network container1

You can also use the docker run-network=<networ-name> option to start a container and immediately connect it to a network.

$ docker run-itd-network=mult-hos-network-ip 172.20.88.22-ip6 2001:db8::8822 busybox

You can pause, restart, and stop containers that are connected to a network. A container connects to its configured networks when it runs.

If specified, the container's IP address(es) is reapplied when a stopped container is restarted. If the IP address is no longer available, the container fails to start. One way to guarantee that the IP address is available is to specify an -i-range when creating the network, and choose the static IP address(es) from outside that range. This ensures that the IP address is not given to another container while this container is not on the network.

$ docker network create-subnet 172.20.0.0/16-i-range 172.20.240.0/20 mult-hos-network

$ docker network connect-ip 172.20.128.2 mult-hos-network container2

To verify the container is connected, use the docker network inspect command. Use docker network disconnect to remove a container from the network.

Once connected in network, containers can communicate using only another container's IP address or name. For overlay networks or custom plugins that support mult-host connectivity, containers connected to the same mult-host network but launched from different Engines can also communicate in this way.

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.

 

OPTIONS

-alias=[]         Add networ-scoped alias for the container

-drive-opt=[]         driver options for the network

-g-priority=0         Highest g-priority provides the default gateway. Accepts positive and negative values.

-ip=""         IPv4 address (e.g., "172.30.100.104")

-ip6=""         IPv6 address (e.g., "2001:db8::33")

-link=         Add link to another container

-lin-loca-ip=[]         Add a lin-local address for the container

 

SEE ALSO

docke-network(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.0 ms