Skip to content

Commit

Permalink
Avoid "grep: warn: recursive directory loop" by using find instead
Browse files Browse the repository at this point in the history
Symlinks inside the Docker graph may point outside of the graph itself.
  • Loading branch information
Steven Schlansker committed Oct 14, 2015
1 parent 310d78d commit ca07425
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker-cleanup-volumes.sh
Expand Up @@ -132,7 +132,7 @@ for container in $container_ids; do
allvolumes+=("${vid}")
else
#check if it's a bindmount, these have a config.json file in the ${volumesdir} but no files in ${vfsdir} (docker 1.6.2 and below)
for bmv in `grep --include config.json -Rl "\"IsBindMount\":true" ${volumesdir} | xargs grep -l "\"Path\":\"${volpath}\""`; do
for bmv in `find ${volumesdir} -name config.json | xargs grep -l "\"IsBindMount\":true" | xargs grep -l "\"Path\":\"${volpath}\""`; do
bmv="$(basename "$(dirname "${bmv}")")"
log_verbose "Found bindmount ${bmv}"
allvolumes+=("${bmv}")
Expand Down

0 comments on commit ca07425

Please sign in to comment.