I am pretty new to docker and was following the documentation found here, trying deploy several containers inside dind using docker-compose 1.14.0 I get the following
docker run -v /home/dudarev/compose/:/compose/ --privileged docker:dind /compose/docker-compose
/usr/local/bin/dockerd-entrypoint.sh: exec: line 21: /compose/docker-compose: not found
Did I miss something?
There is official docker image on dockerhub for docker-compose, just use that.
Follow these steps:
mkdir /root/test
docker-compose.yaml
file with following contents:version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
redis:
image: redis
docker run
command to run docker-compose inside the container.docker run -itd -v /var/run/docker.sock:/var/run/docker.sock -v /root/test/:/var/tmp/ docker/compose:1.24.1 -f /var/tmp/docker-compose.yaml up -d
NOTE: Here /var/tmp directory inside the container will contain docker-compose.yaml file so I have used -f
option to specify complete path of the yaml file. Also docker.sock
is mounted from host onto the container.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With