Skip to content

Instantly share code, notes, and snippets.

@voodootikigod

voodootikigod/notary.sh

Last active Mar 9, 2016
Embed
What would you like to do?
#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "You must provide the DTR FQDN as an argument, $# provided"
export DTR_HOST=$1
echo "Configuring Notary for DTR: $DTR_HOST"
# fix dev certificates
mkdir -p /etc/docker/certs.d/$DTR_HOST
openssl s_client -connect $DTR_HOST:443 -showcerts </dev/null 2>/dev/null | openssl x509 -outform PEM | sudo tee /etc/docker/certs.d/$DTR_HOST/ca.crt
cp /etc/docker/certs.d/$DTR_HOST/ca.crt /usr/local/share/ca-certificates/$DTR_HOST.crt
update-ca-certificates
service docker restart
# install notary service
git clone https://github.com/docker/notary.git
cd notary
docker-compose up -d
export DOCKER_CONTENT_TRUST=1
docker login $DTR_HOST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment