Exposing volumes in dockerfile
firstdorsal opened this issue · 0 comments
firstdorsal commented
Volumes should not be exposed in a dockerfile as they cannot be removed downstream.
Using the volume directive in a dockerfile isn't good practice as they cannot be changed by a user of the image.
See: https://docs.docker.com/engine/reference/builder/#notes-about-specifying-volumes
Changing the volume from within the Dockerfile: If any build steps change the data within the volume after it has been declared, those changes will be discarded.