How to create a volume from a local path in a Dockerfile?
With command line arguments, I can indicate that I want to mount a local directory as a volume:
docker run -i -t -v /path/to/directory/:/mount/point testimage
However, I can’t find anything to describe the syntax to
VOLUME in a Dockerfile to do the same thing. Can anyone explain what this looks like?
One Solution collect form web for “How to create a volume from a local path in a Dockerfile?”
Dockerfiles only define the right side (which paths within the container are volumes) — not the local/left side.
The mapping is done during container creation, not image creation.