Created
April 3, 2019 02:24
-
-
Save geunho/e86595d5805171be8a8f5a40e0c79743 to your computer and use it in GitHub Desktop.
docker get image digest
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
# get digest | |
digest=$(docker inspect --format='{{index .RepoDigests 0}}' $registry/$image:$tag) | |
# parse sha (split as '@' and get second one | |
sha=$(echo $digest | cut -d'@' -f2) | |
# or one line | |
sha=$(docker inspect --format='{{index .RepoDigests 0}}' $registry/$image:$tag | cut -d'@' -f2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment