docker - mount a host volume to a container created through Dockerfile -
new docker, , per documentation dockerfile, due portability, not allowed specify host volume mapping. fine, there way map host volume (i in mac, say, home dir /users/bsr
/data
of ubuntu image) linux container. documentation of docker volume
talking docker run
, not sure how add volume after creating it.
on linux can mount directory of host system docker container passing
-v /path/to/host/directory:/path/to/container/directory
to docker run
command.
you can see here in documentation: https://docs.docker.com/userguide/dockervolumes/#mount-a-host-directory-as-a-data-volume
if using boot2docker things more complicated. problem ist boot2docker runs little linux vm start docker. if mount volume described above mount directory of little linux vm.
a workaround described in readme of boot2docker github page using samba share:
Comments
Post a Comment