objective : assume two hosts A & B. container x at A should be able to be pinged from host B such that this container x is present in the same network as A & B and has its own ip address.
Docker provides two types of network solutions for multi-host networking 1) Overlay network with/without docker swarm 2) Macvlan network. I would like to know for the 2nd type Macvlan networks how can i achieve the objective
When services are running, you can attache them for debugging with
docker exec -ti some-service.1.lz3j7mqb1ux4jp5cwe87gpiok sh
you need to figure out the service name with
docker ps
.Then you can try to ping another service. But this will only work when both services are attached to the same overlay network which is not ingress.
docker network create -d overlay dev
docker service create --network dev --name a ...
docker service create --network dev --name b ...
Then you can
ping a
from b andping b
from a.