Skip to content

Pull image from private registry #1136

Closed

Description

@mestihudson

Hi,

I was trying to pull an image from private registry and I received this message:

[root@baleia sinesp-seguranca]# docker-compose up
Creating sinespseguranca_ldap_1...
Pulling image baleia:5000/sinesp.ldap: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 445, in up
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 184, in up
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 259, in recreate_containers
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 242, in create_container
  File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 824, 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.
[root@baleia sinesp-seguranca]# 

This is my docker-compose.yml file content:

ldap:
  image: baleia:5000/sinesp.ldap
  command: /run.sh
  ports:
    - "389:389"
    - "9830:9830"
  environment:
    ADMIN_DOMAIN: sinesp.bsa.serpro
    SERVER_IDENTIFIER: sinesp
    FULL_MACHINE_NAME: ldap.sinesp.bsa.serpro
    CONFIG_DIR_ADMIN_PWD: password1
    ROOT_DN_PWD: password2
    SUFFIX: dc=sinesp,dc=bsa,dc=serpro
  hostname: ldap.sinesp.bsa.serpro

And this is my /etc/sysconfig/docker file content:

# /etc/sysconfig/docker

# Modify these options if you want to change the way the docker daemon runs
OPTIONS=--selinux-enabled -H fd:// --insecure-registry baleia:5000

# Location used for temporary files, such as those created by
# docker load and build operations. Default is /var/lib/docker/tmp
# Can be overriden by setting the following environment variable.
# DOCKER_TMPDIR=/var/tmp

I have got to push that image on my private registry. What is wrong?

Activity

  1. donhector commented on Mar 24, 2015

    @donhector

    I faced a similar issue, like you I'm using my own insecure registry. Apparently "docker-compose" does not seem to enforce the "--insecure-registry" you have in the Docker daemon config file. Instead I had to explicitly tell "docker-compose" to trust your insecure registry like this:

    docker-compose up --allow-insecure-registry

    It also works for the "run" command, as in:

    docker-compose run --allow-insecure-registry myServiceName

    For more info on those commands you can do:

    docker-compose up --help
    docker-compose run --help

    Whether "docker-compose" should by default honor the Docker daemon setting "--insecure-registry" when no "--allow-insecure-registry" is provided via compose, is something I'd like to know as well...

  2. alunduil commented on Mar 24, 2015

    @alunduil

    Not sure if this is related but after I login with docker login to quay. I'm still not shown as authenticated when using docker-compose up:

    Traceback (most recent call last):
      File "/usr/lib/python-exec/python2.7/docker-compose", line 9, in <module>
        load_entry_point('docker-compose==1.1.0', 'console_scripts', 'docker-compose')()
      File "/usr/lib64/python2.7/site-packages/compose/cli/main.py", line 31, in main
        command.sys_dispatch()
      File "/usr/lib64/python2.7/site-packages/compose/cli/docopt_command.py", line 21, in sys_dispatch
        self.dispatch(sys.argv[1:], None)
      File "/usr/lib64/python2.7/site-packages/compose/cli/command.py", line 27, in dispatch
        super(Command, self).dispatch(*args, **kwargs)
      File "/usr/lib64/python2.7/site-packages/compose/cli/docopt_command.py", line 24, in dispatch
        self.perform_command(*self.parse(argv, global_options))
      File "/usr/lib64/python2.7/site-packages/compose/cli/command.py", line 59, in perform_command
        handler(project, command_options)
      File "/usr/lib64/python2.7/site-packages/compose/cli/main.py", line 445, in up
        do_build=not options['--no-build'],
      File "/usr/lib64/python2.7/site-packages/compose/project.py", line 184, in up
        do_build=do_build):
      File "/usr/lib64/python2.7/site-packages/compose/service.py", line 259, in recreate_containers
        **override_options)
      File "/usr/lib64/python2.7/site-packages/compose/service.py", line 244, in create_container
        stream_output(output, sys.stdout)
      File "/usr/lib64/python2.7/site-packages/compose/progress_stream.py", line 37, in stream_output
        print_output_event(event, stream, is_terminal)
      File "/usr/lib64/python2.7/site-packages/compose/progress_stream.py", line 50, in print_output_event
        raise StreamOutputError(event['errorDetail']['message'])
    compose.progress_stream.StreamOutputError: HTTP code: 403
    

    This is received after trying to pull a private image from quay after having logged in successfully with docker login. I have verified that I have access to the repository by successfully doing:

    docker pull quay.io/private/repo

  3. radekdymacz commented on Mar 24, 2015

    @radekdymacz

    same here

  4. d11wtq commented on Mar 26, 2015

    @d11wtq

    Also having issues using images in private repositories (quay.io). It seems like docker-compose isn't loading the ~/.dockercfg file and therefore getting a 403 when trying to do the pull.

    Looking at the upstream docker-py client, there is code to make this work. Perhaps docker-compose's vendored version doesn't have it?

  5. roadsideseb commented on Apr 10, 2015

    @roadsideseb

    Yes, that's exactly what it is, version 1.1.0 of docker-compose is vendoring docker-py 0.7.2 which doesn't have authentication. It also enforces a version <0.8 for docker-py which means installing via pip doesn't help.
    Installing the 1.2.0rc4 from binary fixed the issue for me.

    For users of homebrew, I've just created a formula for it until 1.2.0 is available on homebrew itself:

    $ brew tap elbaschid/docker
    $ brew update
    $ brew install docker-compose
    
  6. guillaume-brossard commented on Apr 14, 2015

    @guillaume-brossard

    Installing 1.2.0rc4 doesn't solve the issue for me. Also trying to pull from quay.io

  7. alunduil commented on Apr 14, 2015

    @alunduil

    Using docker-py-1.1.0 appears to solve this issue. Is docker-py still bundled? If so can we get it unbundled?

  8. phlegx commented on Apr 22, 2015

    @phlegx

    The flag

    --allow-insecure-registry
    

    Doesn't resolve that for me. Please have a look also here where I describe my problem: #1319

  9. brianlund commented on Apr 29, 2015

    @brianlund

    Same problem here.

    docker pull myregistry/something - works
    docker-compose up - results in compose.progress_stream.StreamOutputError: Authentication is required.

    Running a private registry with valid ssl certificate and basic auth.
    /usr/local/bin/docker-compose --version
    docker-compose 1.2.0

  10. aanand commented on Apr 29, 2015

    @aanand

    Duplicate of #75

  11. vicmosin commented on Jul 28, 2015

    @vicmosin

    Still have the same issue even in 1.4.0rc2.
    Try docker-compose up on quay.io and receive:

    Status 403 trying to pull repository x-repository/activemq: "{\"error\": \"Permission Denied\"}"
    

    normal pull from the same repository works fine

  12. sabretus commented on Nov 10, 2015

    @sabretus

    @vicmosin did you managed to fix this ?

  13. vicmosin commented on Nov 10, 2015

    @vicmosin
  14. fabtho commented on Apr 14, 2016

    @fabtho

    having the same error, this works for me on ubunut vivid (15.04) and docker-compose 1.2 / docker 1.9.1:

    docker-compose pull --allow-insecure-ssl

    I have this problem using docker-compose 1.2 so upgrade did the trick too..

    https://github.com/docker/compose/releases

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