This isn't a full-fledged project. I'm just trying to get inter-container communication working in a Docker-in-Docker swarm running on Vagrant.
The goal is to get the db_slave
service to be able to access the db_master
on port 3306. (This works in Docker for Mac, but I can't get it working in Vagrant.)
I'm creating a repo so I might get some help with my problem.
https://forums.docker.com/t/docker-swarm-docker-in-docker-container-communication/34425/2
- Vagrant
- VirtualBox (Vagrant can install VirtualBox if it's not already on your system.)
From the clone directory, issue:
vagrant up
To SSH into the machine:
vagrant ssh
For the following commands, be sure that you're in an SSH session in the Vagrant VM (see above), then change to the shared vagrant directory:
cd /vagrant/swarm
# change the interface to try another; omit the option to use the default.
swarmbin/start_swarm.sh --advertise-addr=eth0
swarmbin/deploy.sh
This shows whether communication is failing, or not.
docker service logs --follow db_slave
swarmbin/undeploy.sh
swarmbin/kill_swarm.sh