Currently I have the line
in my Dockerfile, designed as a portal for data exchange between the host and container. To achieve that the user needs to use
docker run -it -v /somewhere_host:/somewhere_container <IMAGE>.
I can understand this mapping is not supported in Dockerfile because the host location will be different from case to case. But we should be allowed to specify a fixed mount point in the container, shouldn’t we? For instance
docker run -it -v /somewhere_host: <IMAGE>
will mount the
/somewhere_host directory onto
VOLUME ["/home/data"] is in the Dockerfile.
What’s the correct usage of VOLUME instruction, and if I’d like to achieve the above effect, what should I do?