Skip to content

Instantly share code, notes, and snippets.

@cbron
Forked from alena1108/images.sh
Created June 18, 2020 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbron/b181947e7f7233f0a266266fd47e89e6 to your computer and use it in GitHub Desktop.
Save cbron/b181947e7f7233f0a266266fd47e89e6 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