I am running into an issue with Vagrant/Docker-Compose that seems to be specific to Windows. Here's an overview of the setup and orchestration:
- Vagrant using a boot2docker box
- Several docker containers running inside of boot2docker VM
- Vagrantfile that runs several shell scripts
- Inside of those shell scripts, I run commands that call out from the boot2docker VM to it's child Docker containers. An example of those commands look like:
docker exec -i $(docker-compose ps -q $DOCKER_DBSVC) /bin/bash /db/dockersetup/restoreMyDB.sh
- Running
vagrant up
on my Linux Mint box (and an Ubuntu box) yield working machines that execute all commands properly - Running
vagrant up
on Windows fails on the above command (and commands like it) with aNo such service: my-db-service
- I have run
docker-compose config --services
after upping the containers and can verify that the service names exist, but for whatever reason the command fails on Windows hosts only! - After the scripts fail, the machine still boots up and the Docker containers are alive. I can then
vagrant ssh
into the box (via Windows host), and reference the containers by service name!
Any suggestions?
Line endings, line endings, line endings. The Windows repos were checking out and converting LF to CRLF, so the service names had that goofy CR sitting at the end of them... To fix this, I created the following script based on this answer: