Skip to content

Instantly share code, notes, and snippets.

@lucaswilric
Created February 1, 2019 05:47
Show Gist options
  • Save lucaswilric/0a5ed138accb872be91e3ad2c04be2ab to your computer and use it in GitHub Desktop.
Save lucaswilric/0a5ed138accb872be91e3ad2c04be2ab to your computer and use it in GitHub Desktop.
apt-diff - Diff the installed apt packages between two versions of a Docker image
#!/bin/bash -e
repo=$1
tag1=$2
tag2=$3
get_pkgs () {
img=$1
file=$2
docker pull ${img} > /dev/null
docker run --rm ${img} dpkg --list > ${file}
}
pkgs1=$(mktemp)
pkgs2=$(mktemp)
get_pkgs $repo:$tag1 $pkgs1
get_pkgs $repo:$tag2 $pkgs2
diff ${pkgs1} ${pkgs2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment