Skip to content

Instantly share code, notes, and snippets.

@josketres
Last active August 29, 2016 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josketres/0411cd3eaf83cb193f817bc96a330648 to your computer and use it in GitHub Desktop.
Save josketres/0411cd3eaf83cb193f817bc96a330648 to your computer and use it in GitHub Desktop.
# https://github.com/docker/for-mac/issues/69
# create the directory to mount
mkdir -p ~/test-issue-69/data
# this should work
docker run --rm -it -v ~/test-issue-69/data:/my-data busybox /bin/touch /my-data/foo
# start a container and check periodically if directory is writable
docker run --rm -it -v ~/test-issue-69/data:/my-data busybox /bin/sh -c "while true; do sleep 1;touch /my-data/foo&&echo ok; done"
# let it run and continue in another session/terminal
# recreate directory
rm -rf ~/test-issue-69/data && mkdir ~/test-issue-69/data
# mount directory in another container (this will fail as long as the first container is running)
docker run --rm -it -v ~/test-issue-69/data:/my-data busybox /bin/touch /my-data/foo
# the directory ~/test/issue/69/data cannot be mounted anymore in a docker container
# it can be mounted but the container cannot write to it
docker run --rm -it -v ~/test-issue-69/data:/my-data busybox /bin/touch /my-data/foo # this does not work
# you need to stop the first container and everything will work again
# (sometimes even after killing it the directory doesnt work and you need to restart docker)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment