Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Enviornment variables from .env file are not updated

Featured Replies

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?

Solved by tjb_altf4

  • Community Expert

Most containers don't have a .env file. Do you have a specific container in mind?

  • 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-file

In the Extra Parameters I use: --env-file /mnt/user/appdata/[container]/.env

I 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?

  • Community Expert
  • Solution
3 hours ago, Jaybau said:

https://docs.docker.com/reference/cli/docker/container/run/#set-environment-variables--e-env-env-file

In the Extra Parameters I use: --env-file /mnt/user/appdata/[container]/.env

I 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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.