Here's my docker-compose:
version: '2'
services:
couchpotato:
build:
context: ./couchpotato
dockerfile: Dockerfile
ports:
- 5050:5050
volumes:
- "${PWD}/couchpotato/data:/home/CouchPotato/data/"
- "${PWD}/couchpotato/config:/home/CouchPotato/config/"
When I run it inside the shell, in the directory of the docker-compose.yml, I get:
WARNING: The PWD variable is not set. Defaulting to a blank string.
and the compose starts with PWD being empty.
I don't see any error in the file, as seen here: https://docs.docker.com/compose/environment-variables/
env | grep PWD
from the same shell? – Crazyecho $PWD
is not the same asenv
, the first will pickup variables that have not been exported. – Crazysudo -E bash -c 'docker-compose up'
– Beauvoirsudo su
and then I rundocker-compose up
command to make it work. But still dont know why ${PWD} didnt pick in non-root session. – Gilson