Skip to content

unable to pull from private registry #1175

Closed

Description

@natarajanv

using compose version 1.2.0rc1, docker version 1.5.0

got this error when pulling image from private registry. The docker daemon is set with --insecure-regsitry=hostname:8443

Traceback (most recent call last):
File "", line 3, in
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 464, in up
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 208, in up
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 214, in recreate_containers
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 197, in create_container
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 710, in pull
File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 67, in resolve_repository_name
File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 46, in expand_registry_url
docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled.

When I add --allow-insecure-ssl to the docker-compose, I get this error:

File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 214, in recreate_containers
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 199, in create_container
File "/code/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 37, in stream_output
File "/code/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 50, in print_output_event
compose.progress_stream.StreamOutputError: Authentication is required.

I confirmed that I am logged in by doing a docker pull from the private registry and it works fine.

Thanks for looking...

Activity

  1. envygeeks commented on Mar 30, 2015

    @envygeeks

    We have the same problem here, we are unable to pull from our private registry and I confirmed it is not us by manually pulling from the private registry simply using docker pull and it worked.

  2. kpettijohn commented on Apr 3, 2015

    @kpettijohn

    Just ran into this issue as well. Let me know if I can provide any additional details!

    kp:$ docker login myregistry
    Username (kp):
    Login Succeeded
    
    kp:$ docker-compose up redis
    Creating test_redis_1...
    Pulling image myregistry/redis:latest...
    Pulling repository myregistry/redis
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 464, in up
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.project", line 208, in up
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.service", line 215, in recreate_containers
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.service", line 200, in create_container
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 37, in stream_output
      File "/compose/build/docker-compose/out00-PYZ.pyz/compose.progress_stream", line 50, in print_output_event
    compose.progress_stream.StreamOutputError: Authentication is required.
    

    Normal docker pull

    kp:$ docker pull myregistry/redis
    Pulling repository myregistry/redis
    fdd180cf271e: Download complete
    511136ea3c5a: Download complete
    8771fbfe935c: Download complete
    0e30e84e9513: Download complete
    e5eba74d3255: Download complete
    1a3c5b3fb113: Download complete
    c55851fea3ba: Download complete
    a466e16a027b: Download complete
    536beb617e88: Download complete
    25fa05807e16: Download complete
    a3a3d3d84f43: Download complete
    9f05ed29f20c: Download complete
    c22125556110: Download complete
    ea3a0738c4bb: Download complete
    56a307e0ef9a: Download complete
    0a49231d221c: Download complete
    52887cfaf98e: Download complete
    273380db144b: Download complete
    Status: Downloaded newer image for myregistry/redis:latest
    

    Docker info

    Client version: 1.3.3
    Client API version: 1.15
    Go version (client): go1.3.3
    Git commit (client): d344625
    OS/Arch (client): darwin/amd64
    Server version: 1.4.1
    Server API version: 1.16
    Go version (server): go1.3.3
    Git commit (server): 5bc2ff8
    

    Docker Compose

    docker-compose 1.2.0rc3
    
  3. mattes commented on Apr 16, 2015

    @mattes

    same issue here!

  4. schmunk42 commented on Apr 20, 2015

    @schmunk42

    @natarajanv the allow-insecure workaround works for me, see, could you double check your login hostname (shoudl be with https://..../v1/)

  5. natarajanv commented on Apr 20, 2015

    @natarajanv
    Author

    Yes, it works now. so, need to do 2 things to make it to work:

    have to use --allow-insecure-ssl in the command line
    and edit the .dockercfg file, and add /v1/ to the URL

    Not sure what will happen when I upgrade the registry to V2...

  6. EntilZha commented on May 15, 2015

    @EntilZha

    I have run into this issue using registry V2, but my setup is slightly different. I have a V2 registry setup, with a self signed certificate, and said certificate placed in /etc/docker/certs.d/domain.com/ca.crt (if I recall this is the path docker wants). Using docker pull works correctly with 1.6 and latest version of docker-compose. Using docker-compose up does not work and returns the exception: docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled..

    It seems like this should work correctly since docker should see it as a secured registry

  7. natarajanv commented on May 15, 2015

    @natarajanv
    Author

    There is a new switch like -- allow-insecure-ssl or something like that. Do a help on the pull or up command to verify. Using that switch should solve this problem.

    Sent with Good (www.good.com)


    From: Pedro Rodriguez [email protected]
    Sent: Friday, May 15, 2015 6:07:14 PM
    To: docker/compose
    Cc: Natarajan, Venkat
    Subject: Re: [compose] unable to pull from private registry (#1175)

    I have run into this issue using registry V2, but my setup is slightly different. I have a V2 registry setup, with a self signed certificate, and said certificate placed in /etc/docker/certs.d/domain.com/ca.crt (if I recall this is the path docker wants). Using docker pull works correctly with 1.6 and latest version of docker-compose. Using docker-compose up does not work and returns the exception: docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled..

    It seems like this should work correctly since docker should see it as a secured registry

    Reply to this email directly or view it on GitHubhttps://github.com//issues/1175#issuecomment-102535540.

  8. EntilZha commented on May 15, 2015

    @EntilZha

    What does the switch do? I am going to guess that the insecure ssl would allow self signed certificates? docker itself solves this problem by allowing you to put the ca.crt file within /etc/docker/certs.d/domain.com/ca.crt, docker-compose should honor that I think.

  9. EntilZha commented on May 15, 2015

    @EntilZha

    Based on the source code I read, that flag gets passed all the way to: https://github.com/docker/docker-py/blob/master/docker/auth/auth.py#L29 where it only changes https to http which would be incorrect, since https should be used.

  10. antoineco commented on May 21, 2015

    @antoineco

    Also facing this issue on a v2 private repo secured by a "legitimate" certificate (from Comodo)

    As already mentioned, docker pull succeeds but docker-compose pull doesn't

  11. EntilZha commented on May 21, 2015

    @EntilZha

    My problem ended up being that docker compose 1.2 had a bug where it couldn't parse image names correctly that had a custom port. Solution was to compile a binary from master where it was fixed by a refactor (don't know if it intentionally fixed issue) until 1.3 release.

  12. steve-jansen commented on Jun 10, 2015

    @steve-jansen

    I'm also seeing this issue with a private registry using a custom CA on docker-compose v1.2.0.

    docker pull example.com/myimage works as expected with the CA certs readable at /etc/pki/ca-trust/source/anchors/ (CentOS 7.1, docker 1.6.0)

    docker-compose pull fails for the same image. CA certs are readable at both /etc/pki/ca-trust/source/anchors/ and /etc/docker/certs.d/example.com

    Pulling myimage (example.com/myimage:latest)...
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 231, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 221, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 518, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 710, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 67, in resolve_repository_name
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 46, in expand_registry_url
    docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled.
    

    See also #1319

  13. aanand commented on Jun 10, 2015

    @aanand

    Compose 1.3 contains a fix for registry authentication. Please try it out and tell us if your problems persist:

    https://github.com/docker/compose/releases/tag/1.3.0rc2

  14. schmunk42 commented on Jun 10, 2015

    @schmunk42

    @aanand I have a chicken-and-egg problem since 1.3.0, because it now throws an errors when an image can't be pulled.
    I am using local images, built by docker-compose, which are falsely identified as library images, e.g. image: app_src leads to Unable to downloadlibrary/app_src`.

    How can I distinguish between local images and official ones from Docker Hub?

  15. aanand commented on Jun 10, 2015

    @aanand

    @schmunk42 Does the image tag app_src:latest definitely exist locally when the service in question is started? If so, Compose should not attempt to pull it. Please open an issue if it does.

    I am using local images, built by docker-compose

    Are you trying to reuse an image that's built for another service? If so, that's probably the source of the problem. Replace image: app_src with build: <same path as the other service>.

  16. 3 remaining items

  17. antoineco commented on Jul 6, 2015

    @antoineco

    Same setup as @kuhnroyal, and same error message as @steve-jansen as described in #1319. Might be a duplicate issue.

  18. kuhnroyal commented on Jul 15, 2015

    @kuhnroyal

    Not seeing this anymore after update to docker 1.7.1 and compose 1.3.2

  19. antoineco commented on Jul 15, 2015

    @antoineco

    compose 1.3.2 fixed it for us as well (Docker 1.6 and 1.7)

  20. ITler commented on Jul 20, 2015

    @ITler

    Still see that problem with

    • CentOS 7
    • Docker version 1.7.1, build 786b29d
    • docker-compose version: 1.3.2 (installed this morning)

    My docker-compose.yml:

    registry:
      restart: always
      image: registry:2
      ports:
        - 443:5000
      environment:
        REGISTRY_HTTP_TLS_CERTIFICATE: /certs/mydomain_local.crt
        REGISTRY_HTTP_TLS_KEY: /certs/mydomain_local.key
        REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
      volumes:
        - /var/lib/registry-data:/var/lib/registry
        - /etc/ssl/certs:/certs
    

    Sum up - I use

    • DNS CNAME for accessing the private registry from local network like registry.mydomain.local.
      • Therefore deploying on the docker/docker-compose client machines /etc/docker/certs.d/registry.mydomain.local/ca.crt (also tried mydomain.local/ca.crt and variants with port 443), because I use
    • a self-signed certificate for the registry with CN=mydomain.local (according to official docs), but also tried CN=registry.mydomain.local and CN=*.mydomain.local
    • changed expose port 5000 to host 443

    Output of docker-compose up -d executing on the registry's host machine

    Pulling testimage (registry.mydomain.local/ops/testimage:latest)...
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 32, in main
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 34, in dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 66, in perform_command
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 471, in up
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 245, in up
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 318, in execute_convergence_plan
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 212, in create_container
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 243, in ensure_image_exists
      File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 713, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 590, in pull
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 60, in resolve_repository_name
      File "/code/build/docker-compose/out00-PYZ.pyz/docker.auth.auth", line 39, in expand_registry_url
    docker.errors.DockerException: HTTPS endpoint unresponsive and insecure mode isn't enabled.
    

    The registry log shows this error

    TLS handshake error from <IP:Port>: remote error: unknown certificate authority
    

    BTW: Is it possible, that official documentation is deprecated regarding http:addr - parameter?
    I get the above mentioned error message, only when using http:address: or when not defining it at all.

    Using REST API works (don't know, if it is relevant for this problem), i.e.: curl -k -X GET https://registry.mydomain.local/v2/ops/testimage/tags/list - works

    I have to admit, I'm quite new to the docker world, but I conscientiously followed the docs. What else could I check?

  21. aanand commented on Jul 20, 2015

    @aanand

    @ITler Did you pass --allow-insecure-ssl?

  22. ITler commented on Jul 20, 2015

    @ITler

    This took me hours. I thought I could leave this as I took option 3 from official doc...?
    Using docker-compose up -d --allow-insecure-ssl is not mentioned there in conjunction with self-signed certificates.

  23. antoineco commented on Jul 20, 2015

    @antoineco

    Still it doesn't solve the problem, if you deployed your CA cert correctly compose shouldn't complain.

  24. ITler commented on Jul 21, 2015

    @ITler

    Agree to @antoineco. Docker-compose can't expect to get official certificates, only. Self-signed certificates should always be accepted without complaining, especially (but not exclusively) within local networks... As a consequence, I agree to @EntilZha, too. If a self-signed certificate is provided as /etc/docker/certs.d/domain.com/ca.crt/ then docker-compose should use it, as it would be application-consistent and -transparent behaviour between docker pull and docker-compose pull.

    Maybe one more hint. The name of the option allow-insecure-ssl infers another context for instance another technical behaviour like the webserver should use SSL v1 to v3, which is known to be insecure rather than just allowing self-signed certificates for communication between registry and docker-compose client.

  25. aanand commented on Jul 21, 2015

    @aanand

    We're getting rid of --allow-insecure-ssl (see #1736) as soon as the relevant fix is released in docker-py (see docker/docker-py#681). It's based on old Docker client behaviour that's since been changed.

  26. ITler commented on Jul 21, 2015

    @ITler

    Sounds good from my limited point of view. Thank you!

  27. aanand commented on Jul 23, 2015

    @aanand

    Fixed by #1736 and released in Compose 1.4.0 RC2.

  28. caleb commented on Aug 15, 2015

    @caleb

    I still can't pull from a private repository. I am logged in and docker pull -a docker.example.com/mysql works fine, but using docker-compose I get:

    % docker-compose up -d
    Pulling mysql (docker.example.com/mysql:5.6)...
    Pulling repositorydocker.example.com/mysql
    Authentication is required.
    

    Any ideas? My server uses HTTPS, and is running the v2 registry.

  29. evenfrost commented on Aug 21, 2015

    @evenfrost

    Having it with docker-compose up and private repository with fresh installation on Ubuntu 15.04.

    Docker version 1.8.1, build d12ea79
    docker-compose version: 1.4.0
    docker-py version: 1.3.1
    CPython version: 2.7.9
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions