docker-registry-ui icon indicating copy to clipboard operation
docker-registry-ui copied to clipboard

some question about htpasswd auth standalone

Open lanyur opened this issue 3 months ago • 0 comments

I followed the example of docker-registry-ui/examples/ui-as-standalone/credentials.yml but it couldn't utilize the authentication feature.

services:
  registry:
    image: registry:latest
    container_name : registry
    ports:
      - 5000:5000
    restart: always
    privileged: true
    volumes:
      - /data/docker-registry:/var/lib/registry
      - ./config/credentials.yml:/etc/docker/registry/config.yml
      - ./config/htpasswd:/etc/docker/registry/htpasswd

  ui:
    image: joxit/docker-registry-ui:latest
    container_name: registry-web
    ports:
      - 8000:80
    environment:
      - REGISTRY_TITLE=SWJ Docker Registry
      - NGINX_PROXY_PASS_URL=http://registry:5000
      # - REGISTRY_URL=http://registry:5000
      - DELETE_IMAGES=true
      - SINGLE_REGISTRY=true
    depends_on:
      - registry
    links:
      - registry:registry
    restart: always
    privileged: true

I must add the following configuration to the environment variable node in the registry container definition.

   environment:
      - REGISTRY_AUTH_HTPASSWD_REALM=basic-realm
      - REGISTRY_AUTH_HTPASSWD_PATH=/etc/docker/registry/htpasswd
      - REGISTRY_STORAGE_DELETE_ENABLED=true

lanyur avatar Sep 13 '25 18:09 lanyur