Answer the question
In order to leave comments, you need to log in
How to make two docker friends?
There are two docker assemblies (not 2 containers, but two full-fledged separate assemblies, each of which has its own containers).
Suppose one assembly is an API, and the second is a Client.
Each of them has its own internal network:
...
networks:
travelnet:
driver: bridge
ipam:
config:
- subnet: 172.27.0.0/24
...
ping 192.168.100.17
nothing ping 172.27.0.0.100
- and so the ping does not go. Answer the question
In order to leave comments, you need to log in
I have not used it myself yet, but as far as I know, it is done through external-network
:
In the service of the first assembly, from which you need a connection to the network from another assembly, you prescribe the corresponding network
one from the second assembly, and in the second assembly of the network to which you connect, you prescribe the parameter: external: true
For example:
# first/docker-compose.yml
version: '2'
services:
first:
...
networks:
- network1
networks:
network1:
driver: bridge
...
# second/docker-compose.yml
version: '2'
services:
second:
...
networks:
- first_network1
networks:
first_network1:
external: true
first
doping second
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question