I want to run my cloud in a docker container and store the data outside the container in a volume. So that when my container is destroyed or removed, the data is still persistent.
When passing the volume parameter at docker container run -v /path/to/src:/path/to/target imageName:tag
it runs fine without any issues.
How can I pass the src
and target
destinations into the dockerfile?
VOLUME /path/to/target
will create a volume which has its source somewhere in var/lib/docker
which I do not want.