.env variables are not making it inside the container #697
Replies: 3 comments
-
I noticed the same thing. Adding |
Beta Was this translation helpful? Give feedback.
-
I noticed it also, with a slight variance ... It appears that variables like $PATH are effectively utilized without the need to specify env_file: - .env, whereas variables such as PUID, PGID, and TZ do not work in the same manner and require the inclusion of env_file: - .env as a workaround. Clearly, I do reference the $PATH variable within the Docker Compose file, indicating that .env is indeed referenced, albeit not functioning as one might expect. |
Beta Was this translation helpful? Give feedback.
-
Yes, it is also by default docker compose behavior. |
Beta Was this translation helpful? Give feedback.
-
🛡️ Security Policy
Description
I have the following docker-compose.yml file:
And the following .env file, both in the same folder
Both the files are placed in a folder called pihole, inside a folder called docker_stack:
I have Dockge running and I can make it start pihole without any problems. However, when I start pihole inside dockge, I can then step into the container using the little bash icon. Inside the container I print the environment and get:
But note how TZ=Etc/UTC, even though it should be set to Europe/Copenhagen according to the .env file. If I shut down the container and instead spin up the container using
sudo docker compose up -d
inside the pihole folder I instead get the correct env variables when I test it inside the container.👟 Reproduction steps
See the above for a step by step guide
👀 Expected behavior
I expected that the variables from the environment: section of the docker-compose.yml file were loaded correctly into the container.
😓 Actual Behavior
It does not load the env variables
Dockge Version
1.0.17
💻 Operating System and Arch
Truenas scale 24.10
🌐 Browser
Firefox 132.0
🐋 Docker Version
27.1.1
🟩 NodeJS Version
No response
📝 Relevant log output
No response
Beta Was this translation helpful? Give feedback.
All reactions