Last active
February 1, 2016 08:17
-
-
Save mcnilz/f572efa4620794be38d0 to your computer and use it in GitHub Desktop.
docker one-liners
This file contains 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
# 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