1
0
Fork 0
mirror of https://github.com/imjasonh/cosign-docker-cli-plugins synced 2026-07-07 02:52:25 +00:00
cosign-docker-cli-plugins/docker-verify.sh
2022-04-07 16:25:22 -04:00

25 lines
483 B
Bash
Executable file

#! /usr/bin/env bash
set -e
if [[ "$1" == "docker-cli-plugin-metadata" ]]; then
cat << EOF
{
"SchemaVersion": "0.1.0",
"Vendor": "github.com/imjasonh/cosign-docker-cli-plugins"
}
EOF
exit
fi
if [ "$#" -lt 2 ]; then
echo "Must pass at least one arg, the image to verify"
exit 1
fi
if ! command -v cosign &> /dev/null; then
echo "Must install cosign, please refer to installation page https://docs.sigstore.dev/cosign/installation/"
exit 1
fi
cosign verify ${@:2}