(Created page with "== Docker Networking == ==== Creating the overlay network ==== <code> docker network create --driver bridge phenixnet </code> ==== Add the App to the network ==== <code> doc...") |
|||
Line 33: | Line 33: | ||
==== See the network ==== | ==== See the network ==== | ||
<code> | <code> | ||
docker | docker network ls | ||
</code> <br> | </code> <br> |
Revision as of 22:38, 24 April 2020
Docker Networking
Creating the overlay network
docker network create --driver bridge phenixnet
Add the App to the network
docker run -d --network=phenixnet --name phenixapp -hostname phenixapp -p 8080 nginx
Add another container and ping the App
This will launch a shell on a busybox container, you can ping, curl etc.
docker run -it --rm --network=phenixnet --name phenixapp -hostname phenixclient yauritux/busybox-curl /bin/sh
See the network from the client
curl phenixapp
ping phenixapp
Trash the network
docker network rm
See the network
docker network ls