Attach container outside of the swarm to network of the swarm


Is it possible to attach a container OUTSIDE of the Swarm network to the Swarm network?
So if I have MySQL cluster outside of the swarm, the services in the Swarm needs to access the MySQL cluster.

Yes, you can do it. You can create overlay network with attachable option. Following is an example.
docker network create --attachable --driver overlay oneta
docker service create --name web --network oneta --replicas 2 nginx
docker run –ti --name client --network oneta smakam/myubuntu:v4 bash


1 Like

Thank you very much!