Decode key value (#56)

* Decode key value

The docker content trust repository key is base64-encoded, so let's decode it before dumping it to a file

* decode option is `-d` in Linux
This commit is contained in:
Joseda Rios
2018-09-20 12:10:21 +02:00
committed by GitHub
parent f1fd3b7679
commit 76256c1844
+1 -1
View File
@@ -27,7 +27,7 @@ fi
if [ -n "${DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE:-}" -a -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY:-}" ]; then
tmpdir=$(mktemp -d)
(cd "${tmpdir}" && bash -c 'echo -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY}" > key')
(cd "${tmpdir}" && bash -c 'echo -n "${DOCKER_CONTENT_TRUST_REPOSITORY_KEY}" | base64 -d > key')
chmod 400 "${tmpdir}/key"
docker trust key load "${tmpdir}/key"
rm -rf "${tmpdir}"