Skip to content
Discussion options

You must be logged in to vote

The contents of the volume (/app) are "frozen" once it's declared with the VOLUME instruction, in that they're only modified by ADD and COPY instructions, so changes made to their contents during RUN instructions are being reverted when the instruction completes. This is an older docker build behavior that we mimic and that newer versions of docker build stopped doing.
You can either move the VOLUME instruction to the end of the file so that changes made during RUN instructions won't be discarded when they're made, drop the VOLUME instruction entirely, or update to 5.2, where that behavior will both no longer be the default, and will be selectable with a --compat-volumes flag.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rhatdan
Comment options

@mrghosti3
Comment options

Answer selected by mrghosti3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants