“Remove” a VOLUME in a Dockerfile

后端 未结 3 1671
-上瘾入骨i
-上瘾入骨i 2020-12-18 18:13

I have a Dockerfile extending FROM an image that declares a VOLUME. Is there a way to overwrite the VOLUME directive in such a way, th

3条回答
  •  萌比男神i
    2020-12-18 19:06

    You may overwrite files. Use multistage build and COPY (docker 19.03). One stage Create files outside of VOLUME'd folder. Or at same RUN step which add/modify files copy it outside of that folder. Next stage COPY files from previous stage to VOLUME'd folder.

提交回复
热议问题