I have the following hierarchy:
docker-compose.yml
- deployer/.env
My deployer service:
image: jenkins:docker_noroot
build: ./common/jenkins/.docker
user: "${ID_USER}:${ID_GROUP}"
env_file:
- ./deployer/.env
container_name: central-deployer
volumes:
- $PWD/deployer/jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
networks:
- infrastructure
Now the .env works if I put .env file from deployer to base dir (the same as docker-compose.yml), otherwise I get this warn:
but give me the error:
WARN[0000] The "ID_GROUP" variable is not set. Defaulting to a blank string.
I would need to launch the container by calling the env file from deployer and not in the base directory. How can I solve this problem?
New contributor
Salvatore Esposito is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.