Last active
August 29, 2016 15:40
-
-
Save josketres/0411cd3eaf83cb193f817bc96a330648 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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