i'm trying to setup a docker registry + ui. the problem is i'm running in some troubles using authentication and i don't know where to look for anymore or why it's failing in the first place.
this is my compose file:
version: "3"
services:
registry:
image: registry:3
container_name: registry
ports:
- 5000:5000
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/.htpasswd
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin: '[http://registry:5000]'
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Methods: '[HEAD,GET,OPTIONS,DELETE]'
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Credentials: '[true]'
REGISTRY_HTTP_HEADERS_Access-Control-Allow-Headers: '[Authorization,Accept,Cache-Control]'
REGISTRY_HTTP_HEADERS_Access-Control-Expose-Headers: '[Docker-Content-Digest]'
REGISTRY_STORAGE_DELETE_ENABLED: 'true'
restart: unless-stopped
volumes:
- registry-data:/var/lib/registry
- auth_data:/auth
registry-ui:
image: joxit/docker-registry-ui:latest
container_name: docker_registry_ui
ports:
- "8080:80"
environment:
REGISTRY_TITLE: "My private Docker Registry"
SINGLE_REGISTRY: 'true'
DELETE_IMAGES: 'true'
SHOW_CONTENT_DIGEST: 'true'
NGINX_PROXY_PASS_URL: http://registry:5000
SHOW_CATALOG_NB_TAGS: 'true'
CATALOG_MIN_BRANCHES: '1'
CATALOG_MAX_BRANCHES: '1'
TAGLIST_PAGE_SIZE: '100'
REGISTRY_SECURED: 'false'
CATALOG_ELEMENTS_LIMIT: '1000'
restart: unless-stopped
volumes:
registry-data:
auth_data:
I check for the volume if it is mounted and if it is correct
so locally I have /var/lib/docker/volumes/auth-data/_data/htpasswd
inside my container using docker exec -it I also have an htpasswd file in /auth/htpasswd
(htpasswd refers to the file not a folder)
i check both files the content and it is correct. then i check my password using htpasswd also correct.
when trying docker login http://localhost:5000 i get unauthorized as response no matter what i tried I always have that response.since the password is correct and seems to be mapped i'm out of ideas where to look for. Any help is welcome.