Skip to content

Instantly share code, notes, and snippets.

@aweiteka
Created June 17, 2016 21:07
Show Gist options
  • Save aweiteka/cb09983837b90d2522cca07a1dd3a79d to your computer and use it in GitHub Desktop.
Save aweiteka/cb09983837b90d2522cca07a1dd3a79d to your computer and use it in GitHub Desktop.
atomic sign
#!/bin/bash
# atomic pull <image>
# atomic sign <image> <key>
DIR=tmp
IMAGE=$2
KEY=$3
POLICY_FILE=policy.json
case "$1" in
pull)
# first wipe the previous contents
rm -rf ${DIR}/*
./skopeo --policy ${POLICY_FILE} copy atomic:${IMAGE} dir:${DIR}
;;
sign)
./skopeo copy --sign-by ${KEY} atomic:${IMAGE} atomic:${IMAGE}
;;
*)
echo $"Usage: $0 {pull|sign}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment