Docker. Container and two networks.

Andrey Dmitriev · October 27, 2021

This is a small hint for the case when you need to connect a container to two networks. Example:

docker network create cache # create network cache
docker network create front # create network front
docker create --name redis redis:latest # create container with name redis
docker network connect cache redis # connect network cache to container
docker network connect front redis # connect network front to container
docker start redis # start container

A series of articles about docker:

  1. Docker. Run Container.
  2. Docker. Container and two networks.
  3. Docker. Logging.
  4. Docker. Wordpress.
  5. Docker-compose. Wordpress.
  6. Dockerizing service.

Twitter, Facebook