Skip to content

Instantly share code, notes, and snippets.

@alena1108
Last active June 18, 2020 23:06
Show Gist options
  • Save alena1108/86321f7ec8d632d0f2025dad8472e8c9 to your computer and use it in GitHub Desktop.
Save alena1108/86321f7ec8d632d0f2025dad8472e8c9 to your computer and use it in GitHub Desktop.
images digests generation
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