hashicorp / docker-vault

Official Docker images for Vault
Mozilla Public License 2.0
500 stars 222 forks source link

Exposing volumes in dockerfile #259

Open firstdorsal opened 2 years ago

firstdorsal commented 2 years ago

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.