I have a docker-compose.yml which contains the stuff to start a jenkins-server on CentOS7:
jenkins:
image: jenkins
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- $(which docker):/usr/bin/docker:ro
- /usr/lib64/libsystemd-journal.so.0:/usr/lib/x86_64-linux-gnu/libsystemd-journal.so.0
- /usr/lib64/libsystemd-id128.so.0:/usr/lib/x86_64-linux-gnu/libsystemd-id128.so.0
- /usr/lib64/libdevmapper.so.1.02:/usr/lib/x86_64-linux-gnu/libdevmapper.so.1.02
- /usr/lib64/libgcrypt.so.11:/usr/lib/x86_64-linux-gnu/libgcrypt.so.11
- /usr/lib64/libdw.so.1:/usr/lib/x86_64-linux-gnu/libdw.so.1
ports:
- "8080:8080"
But I'm not able to run the compose because I keep getting an error on $(which docker):/usr/bin/docker:ro
. How do I have to fix this?
Error: ERROR: Invalid interpolation format for "volumes" option in service "jenkins": "$(which docker):/usr/bin/docker:ro"
Is it still not possible to include environment variables? I'm searching for the most right solution. Thanks
$(...)
is not an environment variable, it's command substituion.
You need to use an environment variable to pass in the value.
DOCKER_PATH=$(which docker) docker-compose up
docker-compose.yaml (snippet)
- ${DOCKER_PATH}:/usr/bin/docker:ro
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