Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# 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