Docker – Simple Registry Web UI With Docker-Registry-UI From Joxit

Docker Logo

Hosting your own Docker registry is great, it’s just that… It’s pretty anonymous. You don’t really get to see how many images you have, or their tags, or image digests etc. Unless you want to send manual GET requests via CURL, you can use joxit/docker-registry-ui.

Add the following to “ui service” to your existing registry docker-compose:

  ui:
    image: joxit/docker-registry-ui:latest
    ports:
      - "5001:5001"
    environment:
      - REGISTRY_TITLE=Private Docker Registry
      - NGINX_PROXY_PASS_URL=http://registry:5000
      - NGINX_LISTEN_PORT=5001
      - SINGLE_REGISTRY=true
      - DELETE_IMAGES=true        # Optional, default: false
      - SHOW_CONTENT_DIGEST=true  # Optional, default: false
    depends_on:
      - registry

The end result docker-compose.yml should look like this:

version: '3'

services:
  registry:
    restart: always
    image: registry:2
    ports:
      - "5000:5000"
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
    volumes:
      - ./auth:/auth
      - ./data:/data
  ui:
    image: joxit/docker-registry-ui:latest
    ports:
      - "5001:5001"
    environment:
      - REGISTRY_TITLE=Private Docker Registry
      - NGINX_PROXY_PASS_URL=http://registry:5000
      - NGINX_LISTEN_PORT=5001
      - SINGLE_REGISTRY=true
      - DELETE_IMAGES=true        # Optional, default: false
      - SHOW_CONTENT_DIGEST=true  # Optional, default: false
    depends_on:
      - registry

Append the following to your existing NGinX registry reverse proxy:

location /ui {
   proxy_pass                          http://localhost:5001/;
   proxy_set_header  Host              $http_host;
   proxy_set_header  X-Real-IP         $remote_addr; 
   proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for;
   proxy_set_header  X-Forwarded-Proto $scheme;
   proxy_read_timeout                  900;
  }

  location /docker-registry-ui.js {
   return 301 /ui/docker-registry-ui.js;
  }

  location /docker-registry-ui.css {
   return 301 /ui/docker-registry-ui.css;
}

Your Docker Registry UI should now be available at https://dockrreg.tld/ui!

Login with your usual Registry Credentials

Go Docker UI! ?

Leave a Reply

Your email address will not be published. Required fields are marked *