what does VOLUME command do in Dockerfile?

前端 未结 3 1935
鱼传尺愫
鱼传尺愫 2021-02-13 01:33

I am having it difficulty in understanding added advantage of VOLUME(https://docs.docker.com/engine/reference/builder/#volume) .

In Dockerfile one can have mkdir to cre

3条回答
  •  遇见更好的自我
    2021-02-13 02:15

    A volume is very helpful when we don't want to lose data once the container is deleted. A configuration file, a database data, etc. Hence, you are able to use the same volume with a complete new docker container. If you only create a directory within the Dockefile, the data inside the folder will be deleted toghether with the container.

提交回复
热议问题