Skip to content

Instantly share code, notes, and snippets.

@qwadro
Last active April 11, 2022 09:22
Show Gist options
  • Save qwadro/f59baf62fc7aff6eb8e738b8af636211 to your computer and use it in GitHub Desktop.
Save qwadro/f59baf62fc7aff6eb8e738b8af636211 to your computer and use it in GitHub Desktop.

Revisions

  1. qwadro renamed this gist Apr 11, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. qwadro revised this gist Apr 11, 2022. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,9 @@
    docker images | awk '{print $1 " " $2 " " $3 }' | tr -c "a-z A-Z0-9_.\n-" "%" | while read REPOSITORY TAG IMAGE_ID
    for a in $(docker images | awk '{ print $1 "?" $2 }' | grep -v REPOSITORY )
    do
    echo "== Saving $REPOSITORY $TAG $IMAGE_ID =="
    docker save -o $REPOSITORY-$TAG-$IMAGE_ID.tar $IMAGE_ID
    name=$(echo $a | cut -d? -f1)
    version=$(echo $a | cut -d? -f2)
    shortname=${name##*/}
    echo exporting docker image: $name with version $version
    docker save $name:$version | gzip > "$shortname"_"$version".tar.gz
    echo $shortname=$version >> ../versions.txt
    done
  3. qwadro created this gist Apr 4, 2022.
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    docker images | awk '{print $1 " " $2 " " $3 }' | tr -c "a-z A-Z0-9_.\n-" "%" | while read REPOSITORY TAG IMAGE_ID
    do
    echo "== Saving $REPOSITORY $TAG $IMAGE_ID =="
    docker save -o $REPOSITORY-$TAG-$IMAGE_ID.tar $IMAGE_ID
    done