provisioning - Is there a way to replicate pwd in a volume mount for docker in a boot2docker context? -
so can do: docker -v .:/usr/src/app
or specify in docker-compose.yml
:
web: volumes: - .:/usr/src/app
but when attempt define in dockerfile
:
volume .:/usr/src/app
it doesn't mount anything.
now understand complexities in i'm using osx , have virtualize environment run docker via boot2docker, , boot2docker solves copy issue mounting /user
linux machine running docker.
the documentation wants me explicit, since explicitness require me name user (in case /user/krainboltgreene/code/krainboltgreene/blankrails
) seems non-idiomatic, doesn't work on other people's environments.
what's solution this? mean, can technically working without (as noted above cli , compose works fine), means not being able project specific provisioning (bower install, npm install, vulcanize, etc).
you can't specify host directory volume inside dockerfile, because of portability reasons mention (not have same directories , there security issues regarding mounting sensitive files).
if instead do:
volume /usr/src/app
docker automatically set volume @ run-time folder, mapped directory under /var/lib/docker/volumes
.
if want able make changes during development, suggest using copy
in dockerfile, mounting local changes on top volume @ run-time. has disadvantage if volume mount folder, contents of directory in container hidden (rather merged).
Comments
Post a Comment