Created
February 15, 2023 04:49
-
-
Save imjasonh/901bc83e0977dc0d7866c609dce6c99f to your computer and use it in GitHub Desktop.
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
function gauth() { | |
gcloud auth login && gcloud auth application-default login | |
} | |
# Diff two image filesystems | |
function cdiff-fs() { | |
diff \ | |
<(crane export $1 - --platform ${3:-linux/amd64} | tar -tvf - | sort) \ | |
<(crane export $2 - --platform ${3:-linux/amd64} | tar -tvf - | sort) | |
} | |
# Diff two image configs | |
function cdiff-cfg() { | |
diff \ | |
<(crane config $1 --platform ${3:-linux/amd64} | jq) \ | |
<(crane config $2 --platform ${3:-linux/amd64} | jq) | |
} | |
# Diff two image manifests | |
function cdiff-mf() { | |
diff \ | |
<(crane manifest $1 --platform ${3:-linux/amd64} | jq) \ | |
<(crane manifest $2 --platform ${3:-linux/amd64} | jq) | |
} | |
# Get image size | |
function imgsize() { | |
crane manifest $1 --platform ${2:-linux/amd64} | jq '.config.size + ([.layers[].size] | add)' | numfmt --to=iec | |
} | |
# List files in image | |
function cls() { | |
crane export $1 --platform ${2:-linux/amd64} | tar -tvf - | |
} | |
# Cat file in image | |
function ccat() { | |
crane export $1 --platform ${3:-linux/amd64} - | tar -Oxf - $2 | |
} | |
# Find a package in packages.wolfi.dev | |
function wolfi-ls() { | |
gsutil ls -l gs://wolfi-production-registry-destination/os/${2:-x86_64} | grep ${1:-.*} | |
} | |
function sbom-ls() { | |
cosign download sbom --platform=${2:-linux/amd64} $1 | jq -r '.packages[] | "\(.name) \(.versionInfo)"' | |
} | |
function expected-sha() { | |
curl -sL $1 | sha256sum - | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment