H
H
HellWalk2019-01-29 16:29:38
Docker
HellWalk, 2019-01-29 16:29:38

How to create and connect docker to an existing network?

There are a dozen containers running on their own network - docker_app (this name is displayed if you run docker network ls). You cannot touch their settings in docker-compose.yaml.
It is necessary to create a new container (so far one) through a separate docker-compose.yaml + Dockerfile
For the test, I try to connect phpMyAdmin:

version: '3.4'

services:
  phpmyadmin:
    build: ./phpmyadmin
    restart: on-failure
    ports:
      - 8085:80
    networks:
    - docker_app

networks:
  docker_app:
    driver: bridge
    ipam:
      driver: default

And it creates a separate network docker_app_blablabla
How to create a new container and connect it to an existing network?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2019-01-29
@petermzg

The documentation for docker has a description of external:name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question