Intermediate Docker
Mike Metzger
Data Engineering Consultant
Several commands:
docker network
docker network <command>
docker network <command> --help
docker network ls
to list all docker networks on the hostdocker network create
to create a networkdocker network rm
to remove a networkmynetwork
repl@host:~$ docker network create mynetwork
5ff0febab98f73b74dd753eb44a30f7d7291052b3b1d58b0134589221cb8e33d
repl@host:~$ docker network ls
NETWORK ID NAME DRIVER SCOPE 2edc5ae4838c bridge bridge local a92988382711 host host local 5ff0febab98f mynetwork bridge local 5464ed866dad none null local
docker run --network <networkname> ...
docker run --network mynetwork ubuntu bash
docker network connect <networkname> <container>
docker network connect mynetwork ubuntu-B
docker network inspect <networkname>
repl@host:~$ docker network inspect mynetwork
"Name": "mynetwork",
...
"Driver": "bridge",
...
Containers": { "2be08aa942029191350d4bceb8816254af8713dd6f7dcbadcab8f068f7dbfdfa": {
"Name": "unruffled_kare",
"EndpointID": "29739356ae200e1e901d2eabef05efaca0fb37e1a4e1a4c3bf369f2892ca6c4b",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
Intermediate Docker