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

Registry htpasswd support not working with '$' in password #87

Open
lhenry7 opened this issue Jan 10, 2019 · 0 comments
Open

Registry htpasswd support not working with '$' in password #87

lhenry7 opened this issue Jan 10, 2019 · 0 comments

Comments

@lhenry7
Copy link

lhenry7 commented Jan 10, 2019

Docker Info
Containers: 4
Running: 4
Paused: 0
Stopped: 0
Images: 148
Server Version: 18.03.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: cfd04396dc68220d1cecbe686a6cc3aa5ce3667c
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.16.0-1.el7.elrepo.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.789GiB
Name: ip-10-227-81-147
ID: SHVB:UU7A:23FQ:KZ7N:2XFH:NW22:OQIR:OP7A:GYTI:HCBP:6BVY:SNOV
Docker Root Dir: /docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
dsg.infra
127.0.0.0/8
Live Restore Enabled: false

Registry config.yml
version: 0.1

storage:
filesystem:
rootdirectory: /registry
delete:
enabled: true

http:
addr: 0.0.0.0:443
tls:
certificate: /certs/my-registry.crt
key: /certs/my-registry.key

auth:
htpasswd:
realm: Registry Realm
path: /auth/htpasswd-file

log:
level: debug

I ran:
docker run --rm --entrypoint htpasswd registry:2.6 -Bbn username pass$word > /var/lib/registry/auth/htpasswd-file

Then started registry like this:
registry:
restart: always
image: registry:2.6
ports:
- 443:443
volumes:
- /var/lib/registry/conf/config.yml:/etc/docker/registry/config.yml
- /var/lib/registry/certs:/certs
- /var/lib/registry/auth:/auth

And when I do:
docker login https://localhost
Username: username
Password:
Error response from daemon: login attempt to https://localhost/v2/ failed with status: 401 Unauthorized

Recreate the htpasswd file with 'username' 'password'
and it works. Tried with 2.7 as well, same behavior

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

No branches or pull requests

1 participant