Created
April 12, 2020 21:02
-
-
Save rfay/c256f13bf093a6627e05ebc0aa753f31 to your computer and use it in GitHub Desktop.
Try to repro slow docker sync volume behavior
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
| #!/bin/bash | |
| mountdir=/mnt/testdir | |
| touch f{1..10000}.txt | |
| c1=$(docker run -d --rm -v "/$PWD:$mountdir" -w /$mountdir debian sleep 60) | |
| c2=$(docker run -d --rm -v "/$PWD:$mountdir" -w /$mountdir debian sleep 60) | |
| docker exec -w /$mountdir $c1 bash -c "echo -n 'files found inside before removal: ' && echo f*.txt | wc -w" | |
| docker stop -t0 $c1 | |
| rm f*.txt | |
| docker run --rm -v "/$PWD:$mountdir" -w /$mountdir debian bash -c "echo -n 'files found inside after removal: ' && echo f*.txt | fgrep -v 'f*.txt' | wc -w" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment