Oversimplified HOWTO based on the Docker networking tutorial.
docker network create --driver bridge redis-net
docker run --name redis -d --network redis-net redis
We assume that it wants to connect to a Redis server named redis
, for example
the app used in the official Docker tutorial.
docker run --name webapp -p 4000:80 --network redis-net our-web-app-that-uses-redis
This runs until Ctrl-C.
docker stop redis
docker container rm redis webapp
docker network rm redis-net