Steps to Reproduce:
.devcontainer
โโโ .env
โโโ devcontainer.env
โโโ devcontainer.json
โโโ docker
โ โโโ images
โ โโโ mysql
โ โ โโโ Dockerfile
โ โ โโโ conf.d
โ โ โ โโโ dev.cnf
โ โ โโโ entrypoint.sh
โ โ โโโ init
โ โ โโโ demo.sql
โ โโโ python
โ โโโ .gitkeep
โ โโโ Dockerfile
โโโ docker-compose.yml
DOCKER_CACHE_PATH=../cache/docker
"dockerComposeFile": "docker-compose.yml",
"service": "python",
"workspaceFolder": "/home/appuser",
"initializeCommand": "export $(cat ./.devcontainer/devcontainer.env | xargs) && printenv",
"postCreateCommand": "pipenv install --dev && echo 'eval \"$(env _PIPENV_COMPLETE=source-bash pipenv)\"' >> ~/.bashrc",
"remoteUser": "appuser",
services:
mysql:
build:
context: ./docker/images/mysql
ports:
- 3306:3306
volumes:
- ${DOCKER_CACHE_PATH}/db:/var/lib/mysql
[2020-11-02T22:47:20.493Z] [PID 62411] DOCKER_CACHE_PATH=../cache/docker
[2020-11-02T22:47:20.495Z] [PID 62411] [594 ms] Start: Run: docker-compose version --short
[2020-11-02T22:47:20.858Z] [PID 62411] [957 ms] Start: Run: docker ps -q -a --filter label=com.docker.compose.project=playgroundpython_devcontainer --filter label=com.docker.compose.service=python
[2020-11-02T22:47:20.979Z] [PID 62411] [1078 ms] Start: Run: docker-compose -f /Users/tonysoloveyv/Projects/playground.python/.devcontainer/docker-compose.yml config --services
[2020-11-02T22:47:21.356Z] [PID 62411] [1455 ms] mysql
[2020-11-02T22:47:21.357Z] [PID 62411] [1456 ms] The DOCKER_CACHE_PATH variable is not set. Defaulting to a blank string.
What am I doing wrong?
Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes
Try moving .env to your project folder (one folder up). We use that as the working directory for docker-compose and that's where it looks for a .env file.
Most helpful comment
Try moving
.envto your project folder (one folder up). We use that as the working directory fordocker-composeand that's where it looks for a.envfile.