Skip to content

Instantly share code, notes, and snippets.

@rfay
Created April 12, 2020 21:02
Show Gist options
  • Select an option

  • Save rfay/c256f13bf093a6627e05ebc0aa753f31 to your computer and use it in GitHub Desktop.

Select an option

Save rfay/c256f13bf093a6627e05ebc0aa753f31 to your computer and use it in GitHub Desktop.
Try to repro slow docker sync volume behavior
#!/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