How to use docker network
If you want to connect two containers in the same docker network.
Just do the 3 following steps:
- Create network
docker network create test-network
- Connect first container
docker run --name c1--network test-network nginx:latest
- Connect second container
docker run --name c2 --network test-network nginx:latest
Use exec to connect to the container.
docker exec -it c2 /bin/bash
(Should be provided to use curl or ping)
That is it.
Last but not least
If the post is updated, the creation date, will be pushed. So it might happend, you see an existing page back on frontpage. I think, this approach is valid, so wrong information or gained information is covered. But if I am going to write a new part of topic, I might include an updated link to the new post.Home