Created
June 17, 2016 21:07
-
-
Save aweiteka/cb09983837b90d2522cca07a1dd3a79d to your computer and use it in GitHub Desktop.
atomic sign
This file contains hidden or 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
#!/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