notary: Error establishing connection to trust repository

followed following steps to setup notary :

  1. git clone https://github.com/docker/notary.git
  2. cd notary
  3. echo “127.0.0.1 notaryserver” >> /etc/hosts
  4. cp fixtures/root-ca.crt ~/.docker/tls/notaryserver:4443
  5. cp fixtures/root-ca.crt /etc/pki/ca-trust/source/anchors/.
  6. update-ca-trust extract
  7. docker-compose up
  8. export DOCKER_CONTENT_TRUST_SERVER=https://notaryserver:4443
  9. export DOCKER_CONTENT_TRUST=1
  10. openssl s_client -connect notaryserver:4443 -CAfile fixtures/root-ca.crt -no_ssl3 -no_ssl2 giving correct output with “Verify return code: 0 (ok)”

but when i run docker build command, i am getting below error

Error establishing connection to trust repository: readdirent: not a directory
Sending build context to Docker daemon

An error occurred trying to connect: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%7D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&rm=1&shmsize=0&ulimits=null: readdirent: not a directory

I have no idea which directory it is looking, Can someone please let me know what i am missing here?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

I think this cp fixtures/root-ca.crt ~/.docker/tls/notaryserver:4443 might also be an issue (especially given the error). If my memory serves, notaryserver:4443 need to be a directory, so that command should really be:

$> mkdir ~/.docker/tls/notaryserver:4443
$> cp fixtures/root-ca.crt ~/.docker/tls/notaryserver:4443/ca.crt

@hridyeshpant: if you suspect you have unwanted data locally and on your server, you can delete the data with this command. I would recommend doing this before trying @judavi’s commands:

notary -s https://notaryserver:4443 -d ~/.docker/trust delete test.com/collection --remote