Last active
April 6, 2016 18:33
-
-
Save putnamhill/d8abaf4c5bf8ee326ae2 to your computer and use it in GitHub Desktop.
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
# Use awk to to redirect docker build output to stderr for visual feedback | |
# while capturing the image id on stdout when the build is sucessfull | |
ID=$(docker build . | awk '{print > "/dev/stderr"} END {if (/^Successfully built /) print $NF; else exit 1}') | |
# given docker volume path, return local storage path | |
doc2loc(){ docker inspect --format "{{range .Mounts}}{{if eq .Destination \"$1\"}}{{.Source}}{{end}}{{end}}" $2;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment