I’m trying to use Content Trust delegation following the instructions here: Docker Docs
I’ve got as far as publishing the delegation to Notary (apparently successfully); however, the Docker CLI fails to pull or push successfully after that.
I’m using:
- Docker version 1.9.1, build a34a1d5,
- Notary server built from commit docker-v1.10.2 (13de903e),
- Notary client from https://github.com/docker/notary/releases/download/v0.2.0/notary-v0.2_linux-amd64.tar.gz
- host OS: Linux 3.10.0
(I’ve tried various other combinations of Docker and Notary version, but this is the farthest I’ve managed to get).
This is the output from a push to a brand-new repository, followed by Notary content delegation, and subsequent attempted Docker pull of the image that was just pushed :
> export NOTARY_ROOT_PASSPHRASE=root
> export NOTARY_TARGETS_PASSPHRASE=repository
> export NOTARY_SNAPSHOT_PASSPHRASE=repository
> export DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE=root
> export DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=repository
> export DOCKER_CONTENT_TRUST=1
> export NOTARY_SERVER=https://notary-server:4443
> export DOCKER_CONTENT_TRUST_SERVER=$NOTARY_SERVER
> docker tag -f good_image registry-server:5000/good_image:latest
> docker push registry-server:5000/good_image:latest
The push refers to a repository [registry-server:5000/good_image] (len: 1)
634a8be49a18: Preparing
634a8be49a18: Pushing
634a8be49a18: Pushed
51f9dd12da79: Preparing
51f9dd12da79: Pushing
51f9dd12da79: Pushed
73e8d4f6bf84: Preparing
73e8d4f6bf84: Pushing
73e8d4f6bf84: Pushed
latest: digest: sha256:f434bfc771b78180862207bafaf52f4fc8f067dd9b3544556f94fdffd8b67f34 size: 5947
Signing and pushing trust metadata
Finished initializing “registry-server:5000/good_image”
> /root/notary/notary -s $NOTARY_SERVER -d /root/.docker/trust key rotate registry-server:5000/good_image -t snapshot -r
> /root/notary/notary -s $NOTARY_SERVER -d /root/.docker/trust delegation add registry-server:5000/good_image targets/releases /root/delegation.crt --all-paths
Addition of delegation role targets/releases with keys [74c5cd5e53f0b2839325350ee761f703dbbb9a18c42bde107dd63fad1a98095d], with paths [“” ], to repository “registry-server:5000/good_image” staged for next publish.
> /root/notary/notary -s $NOTARY_SERVER -d /root/.docker/trust publish registry-server:5000/good_image
Pushing changes to registry-server:5000/good_image
> docker pull registry-server:5000/good_image:latest
time=“2016-04-13T15:36:07Z” level=error msg=“Client Update (Targets): json: cannot unmarshal object into Go value of type data.PublicKey”
json: cannot unmarshal object into Go value of type data.PublicKey
> echo $?
1
I tried pulling with debug output enabled:
> docker -D pull registry-server:5000/good_image:latest | tail -n 14
time=“2016-04-13T15:34:17Z” level=debug msg=“successfully verified timestamp”
time=“2016-04-13T15:34:17Z” level=debug msg=“verifying signature for key ID: ceb219b20eaca18979e96d3c3c729c72dc62f91ef41d2e4936c52da5e7d30673”
time=“2016-04-13T15:34:17Z” level=debug msg=“continuing b/c keyid was invalid: ceb219b20eaca18979e96d3c3c729c72dc62f91ef41d2e4936c52da5e7d30673 for roledata &{{[aeccaa04556c95b62387ff005ed9a1f09a319d3e9a8fda0ac417eed4ba952845] %!s(int=1)} snapshot }\n”
time=“2016-04-13T15:34:17Z” level=debug msg=“successfully verified snapshot”
time=“2016-04-13T15:34:17Z” level=debug msg=“200 when retrieving metadata for targets”
time=“2016-04-13T15:34:17Z” level=debug msg=“targets role has key IDs: 292a62f9a405904fc886ce6fa40cd5f18d9036d3eb9df724d62a9ce3e858503b”
time=“2016-04-13T15:34:17Z” level=debug msg=“verifying signature for key ID: 292a62f9a405904fc886ce6fa40cd5f18d9036d3eb9df724d62a9ce3e858503b”
time=“2016-04-13T15:34:17Z” level=debug msg=“successfully verified targets”
time=“2016-04-13T15:34:17Z” level=error msg=“Client Update (Targets): json: cannot unmarshal object into Go value of type data.PublicKey”
json: cannot unmarshal object into Go value of type data.PublicKey
Any help would be appreciated – thanks! I can add more debug output wherever it would be useful, but didn’t want to make this post too unreadable.