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
I'm using this image with a docker-compose file to set environment variables, works nicely. However the VOLUME in the Dockerfile of this image is causing 5 new volume to be created every single time I do a docker-compose up/down.
What's the purpose of declaring those VOLUMEs in the Dockerfile? I know I can declare named volumes in my docker-compose file but I'm not sure why the VOLUME is needed in the Dockerfile in the first place.
The text was updated successfully, but these errors were encountered:
I must admit, that the documentation does not provide much guidance regarding when to declare VOLUMEs and when not. Some even advice against using this feature.
I think wisely used, VOLUMEs are a good thing, as they clearly define where a specific application is writing data to that one might want to persist. On the other hand it is up to the user to hook up named volumes he/she is interested in. Nevertheless it is important to know how to get rid of the anonymous volumes that are automatically created if you don't explicitly specify a volume. It depends on how you are running the container:
docker compose down --volumes
docker container rm --volumes
Now I understand why the previously configured shares are still accessible. The smb.conf file is located in the /etc volume created by the Dockerfile. So whenever I modify the SHARE environment variable in the docker-compose.yml file, it is appended to the configuration file, and the previous one is not erased even if the container is recreated.
This is not a common practice in Docker. If the configuration is intended to be persistent, the documentation should recommend that users supply a volume for that directory.
I'm using this image with a docker-compose file to set environment variables, works nicely. However the VOLUME in the Dockerfile of this image is causing 5 new volume to be created every single time I do a docker-compose up/down.
What's the purpose of declaring those VOLUMEs in the Dockerfile? I know I can declare named volumes in my docker-compose file but I'm not sure why the VOLUME is needed in the Dockerfile in the first place.
The text was updated successfully, but these errors were encountered: