docker / cli

The Docker CLI
Apache License 2.0
4.98k stars 1.94k forks source link

self-cert notary server with port is not support by docker trust in Docker for Windows #1533

Open heww opened 6 years ago

heww commented 6 years ago

Description

Docker trust for notary server url with port (eg https://notary.example.com:4443 ) is not work in Docker for Windows

Docker will read certs from C:\Users\xxx.docker\tls\notary.example.com:4443 dirs, but I can not create dir with : in Windows.

I think certificateDirectory should be cleaned in Windows.

Steps to reproduce the issue:

  1. create C:\Users\xxx.docker\tls\notary.example.com4443 dir and copy ca.crt to it
  2. $env:DOCKER_CONTENT_TRUST_SERVER='https://notary.example.com:4443'
  3. $env: DOCKER_CONTENT_TRUST=1
  4. docker -D push index.example.com/foo/dotnet-samples:dotnetapp

Describe the results you received: The push refers to repository [index.example.com/foo/dotnet-samples:dotnetapp] xxxxxxx: Layer already exists xxxxxxx: Layer already exists xxxxxxx: Layer already exists dotnetapp: digest: sha256:xxxxxx size: 2406 Signing and pushing trust metadata DEBU[0001] reading certificate directory: C:\Users\xxx.docker\tls\notary.example.com:4443 DEBU[0001] Error pinging notary server "hosts://notary.example.com:4443/v2/": Get https://notary.example.com:4443/v2/: x509: certificate signed by unknow authority DEBU[0001] Making dir path: C:\Users\xxx.docker\trust\tuf\index.example.com\foo\dotnet-samples\changelist Error: error contacting notary server: x509: certificate signed by unknow authority

Describe the results you expected: Push the image to registry and successfully signed

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client: Docker Engine - Community
 Version: 18.09.0
 API version:  1.39

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

adeniyistephen commented 4 years ago

@GordonTheTurtle I would love to work on this, Please provide pointers and input on how to work on it. Thanks

psandeep09 commented 1 year ago

Yes facing the same issue error establishing connection to trust repository: mkdir C:\Users\Pravinh\.docker\trust\tuf\containers.arjunphp.com:5000: The directory name is invalid.

windows unable to create directory called containers.arjunphp.com:5000