Skip to content

Instantly share code, notes, and snippets.

@mcnilz
Last active February 1, 2016 08:17
Show Gist options
  • Save mcnilz/f572efa4620794be38d0 to your computer and use it in GitHub Desktop.
Save mcnilz/f572efa4620794be38d0 to your computer and use it in GitHub Desktop.
docker one-liners
# list mounts of a container:
docker inspect --format='{{range $mount := .Mounts}}{{$mount.Source}}{{"\n ->\t"}}{{$mount.Destination}}{{"\n"}}{{end}}' $CONTAINER_ID
# for all running containers
for ID in $( docker ps -q ); do docker inspect --format='# {{.Name}}{{":\n"}}{{range $mount := .Mounts}}{{$mount.Source}}{{"\n ->\t"}}{{$mount.Destination}}{{"\n"}}{{end}}' $ID; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment