The usage scenario is like this:
I have an AWS EC2 instance already provisioned with docker-machine.
I want to use docker-compose to remotely start a few containers on that EC2 instance.
The compose file has a section like this:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "8888:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /home/ubuntu/nginx.tmpl:/app/nginx.tmpl:ro
If I use docker-compose up -d
locally, it'll work, since the "/home/ubuntu/nginx.tmpl" file is present on my local machine.
But if I try to use docker-compose to control the remote daemon in AWS like this:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://x.y:2376"
export DOCKER_CERT_PATH="somedir"
docker-compose up -d
It'll fail, since the "/home/ubuntu/nginx.tmpl" file is not present in the remote machine.
I have tried creating such a file in the remote machine under the same directory, it works, but it feels wrong ... ...
What is a better way to mount a local file to a remote docker daemon?