You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time when I restart the docker container, I have to reset all the settings, specially for the node label.
It would be better to persist the setting somewhere and load it when the container is started.
The text was updated successfully, but these errors were encountered:
If I understand your problem correctly, you want to persist container settings, such as node labels, across restarts and I suppose it's a common Docker level problem statement. Docker’s volume mount feature is a great way to achieve this. By using volumes, you can store configuration files or settings on your local filesystem and mount them inside the container. This ensures that changes persist even after restarting the container.
Here’s how you can do it:
Identify the file or location where the settings (e.g., node labels) are stored in your container.
Create a corresponding file or directory on your host system to hold these settings. For example:
mkdir -p ~/docker-settings
Use Docker's -v or --mount option to bind this directory to the appropriate location inside your container. For example:
docker run -v ~/docker-settings:/path/to/settings your-image
Replace /path/to/settings with the path inside the container where the configuration file is stored.
Now, any changes made to the settings will persist in the ~/docker-settings directory on your host system, even if the container is restarted.
If the settings are stored in the container's environment variables rather than a file, you might consider using a .env file to persist and reapply them when restarting the container.
By implementing this, you can ensure that your node labels and other settings are retained across container restarts.
Every time when I restart the docker container, I have to reset all the settings, specially for the node label.
It would be better to persist the setting somewhere and load it when the container is started.
The text was updated successfully, but these errors were encountered: