Enable signing of images to push process (#53)

This change enables Docker Content Trust for the tags being pushed.

I configured Travis to set the required key and passphrase.

Fixes #48.
This commit is contained in:
Alejandro Ruiz 2018-09-19 16:45:07 +02:00 committed by GitHub
parent c3b5ba1143
commit 883d28ccad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,14 @@ if [ -n "${GCR_KEY:-}" ]; then
gcloud auth activate-service-account "$GCR_EMAIL" --key-file <(echo "$GCR_KEY")
fi
if [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE:-}" -a -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY:-}" ]; then
tmpdir=$(mktemp -d)
bash -c 'echo -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY}" > "${tmpdir}/key"'
docker trust key load "${tmpdir}/key"
rm -rf "${tmpdir}"
export DOCKER_CONTENT_TRUST=1
fi
for DIST in $DISTS; do
docker push "${BASENAME}:${DIST}"
docker push "${QUAY_BASENAME}:${DIST}"