Dockers that talk to each other
Bridge networks
Define bridge
docker network create bartek-net
network flag
When creating a new container, you can specify one or more –network flags:
docker run --detach --publish=8080:80 --name=webserver --network bartek-net nginx
You can test it with:
curl http://0.0.0.0:8080
Another docker with the same network flag talk to this docker by resolving name webserver
:
docker run --network bartek-net byrnedo/alpine-curl http://webserver:80
Updated: 2020-12-02