Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit login instructions and two minor fixes #2

Closed
wants to merge 4 commits into from

Conversation

jonatanblue
Copy link

When I tried running this, it threw back this error:
docker push localhost:5000/mozart/busybox

The push refers to a repository [localhost:5000/mozart/busybox]
5f70bf18a086: Image push failed
16a7ebd37800: Preparing
Get http://localhost:5000/v2/: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

The solution was to explicitly log in first with docker login localhost:5000.

When I tried running this, it threw back this error:
docker push localhost:5000/mozart/busybox

```The push refers to a repository [localhost:5000/mozart/busybox]
5f70bf18a086: Image push failed
16a7ebd37800: Preparing
Get http://localhost:5000/v2/: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
```
The solution was to explicitly log in first with ``docker login localhost:5000``.
@@ -143,6 +143,8 @@ cfa753dfea5e: Image successfully pushed
latest: digest: sha256:15eda5ab78f31658ab922650eebe9da9ccc6c16462d5ef0bfd6d9f29b8800569 size: 2743
```

If you are not automatically prompted to log in, you can explicitly log in before pushing, with ``docker login 0.0.0.0:5000``.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One backslash is enough. Please correct this and then I'll merge this PR. Thank you for contributing.

if entrypoint is specified the container fails to launch
workaround for error `authn kwk#2 returned error: open /tmp/ldap_password.txt.clean: no such file or directory` when starting auth container
@jonatanblue jonatanblue changed the title Added explicit login instruction to readme Explicit login instructions and two minor fixes Mar 11, 2016
@jonatanblue
Copy link
Author

This PR now also addresses two minor errors.

System

Reproduced on:

  • Docker version 1.10.3, build 20f81dd
  • docker-compose version 1.6.2, build 4d72027
  • Ubuntu 14.04 3.13.0-74-generic

Errors

Cannot start auth container

To reproduce the error, follow the instructions in the readme (as root):

# clone repo
git clone https://github.com/kwk/docker-registry-setup.git
cd docker-registry-setup/
# run docker compose
docker-compose up --force-recreate
Creating dockerregistrysetup_registry_1
Building ldap
Step 1 : FROM debian:jessie
...
Creating dockerregistrysetup_auth_1
ERROR: Container command not found or does not exist.
# it fails to start the auth container
# but both ldap and registry are up and running
# check docker compose status
docker-compose ps
             Name                           Command                State             Ports
---------------------------------------------------------------------------------------------------
dockerregistrysetup_auth_1       /start.sh                        Exit 127
dockerregistrysetup_ldap_1       /usr/bin/supervisord -c /e ...   Up         389/tcp
dockerregistrysetup_registry_1   /bin/registry /etc/docker/ ...   Up         0.0.0.0:5000->5000/tcp
# check docker status
docker ps -a
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS                    NAMES
93f4b515f06b        cesanta/docker_auth        "/start.sh"              7 minutes ago       Created                                      dockerregistrysetup_auth_1
fb20c3faf621        dockerregistrysetup_ldap   "/usr/bin/supervisord"   7 minutes ago       Up 7 minutes        389/tcp                  dockerregistrysetup_ldap_1
3080a68e9c84        registry:2                 "/bin/registry /etc/d"   9 minutes ago       Up 9 minutes        0.0.0.0:5000->5000/tcp   dockerregistrysetup_registry_1

The solution is to remove entrypoint: /start.sh from auth: in docker-compose.yml.

ldap_password file not found

When attempting to log in to the registry this error is shown:

docker login localhost:5000
Username (mozart):
Password:
Error response from daemon: no successful auth challenge for https://localhost:5000/v2/ - errors: [token auth attempt for registry https://localhost:5000/v2/: https://0.0.0.0:5001/auth?account=mozart&service=my.docker.registry request failed with status: 500 Internal Server Error]

The auth container logs this error:

auth_1     | E0311 17:34:15.185356       1 server.go:174] {mozart:***@172.17.0.1:44544 []}: authn #2 returned error: open /tmp/ldap_password.txt.clean: no such file or directory

The workaround is to change the path to the passwords file to config/ldap_password.txt in auth/config/auth_config.yml.

@@ -26,7 +26,7 @@ ldap_auth:
# specify them here. Plain text password is read from the file.
bind_dn: "uid=serviceaccount,ou=it,dc=example,dc=com"
# Make sure you remove newlines and carriage returns from the password file.
bind_password_file: /tmp/ldap_password.txt.clean
bind_password_file: /config/ldap_password.txt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a start.sh to fix this issue as work around already.

https://github.com/kwk/docker-registry-setup/blob/master/auth/start.sh#L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants