February 26Feb 26 When I change an environment variable within the .env file and restart (or stop/start) a container, the value for the environment variable is not updated (retains the value).How do I restart a docker container to refresh/update the environment variable from the .env file?
February 26Feb 26 Community Expert Most containers don't have a .env file. Do you have a specific container in mind?
February 26Feb 26 Author 34 minutes ago, trurl said:Most containers don't have a .env file. Do you have a specific container in mind?https://docs.docker.com/reference/cli/docker/container/run/#set-environment-variables--e-env-env-fileIn the Extra Parameters I use: --env-file /mnt/user/appdata/[container]/.envI use linuxserver.io images.From my reading it appears the container may persist metadata with just a simple restart. But creating and changing an environment variable within the Unraid template will recreate the container, including recreating the environment variable metadata. So perhaps there's a way to do a clean container restart with Unraid?
February 26Feb 26 Community Expert Solution 3 hours ago, Jaybau said:https://docs.docker.com/reference/cli/docker/container/run/#set-environment-variables--e-env-env-fileIn the Extra Parameters I use: --env-file /mnt/user/appdata/[container]/.envI use linuxserver.io images.From my reading it appears the container may persist metadata with just a simple restart. But creating and changing an environment variable within the Unraid template will recreate the container, including recreating the environment variable metadata. So perhaps there's a way to do a clean container restart with Unraid?turning on advanced view on docker (list) page and using the force update option is the easiest way to force the env to be refreshed when working with env files
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.