Last active
June 18, 2020 23:06
-
-
Save alena1108/86321f7ec8d632d0f2025dad8472e8c9 to your computer and use it in GitHub Desktop.
images digests generation
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
while read in | |
do | |
docker pull "$in" | |
repo=$(echo $in | cut -f1 -d/) | |
image_tmp=$(echo $in | cut -f2 -d/) | |
image=$(echo $image_tmp | cut -f1 -d:) | |
tag=$(echo $image_tmp | cut -f2 -d:) | |
docker images --digests | grep "$image" | grep "$repo" | grep "$tag" | awk '{print "| " $1 ":" $2 " | " $3 " |"}' | sed 's/| //g' | sed 's/ |//g' >> rancher-images-digests.txt | |
docker rmi "$in" | |
done < rancher-images.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment