Joxit / docker-registry-ui

The simplest and most complete UI for your private registry
https://joxit.dev/docker-registry-ui/
GNU Affero General Public License v3.0
2.57k stars 323 forks source link

How to run `docker manifest` when use docker-registry-ui? #250

Open devome opened 2 years ago

devome commented 2 years ago

My registry config:

version: 0.1
log:
  fields:
    service: registry
storage:
  delete:
    enabled: true
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
    Access-Control-Allow-Origin: ['*']

OS: Debian 11 Arch: amd64 Docker version: 20.10.14 Docker registry version: 2.8.1

When docker-registry-ui are not used

docker-compose file:

version: "3.7"
services:
  registry:
    image: registry:latest
    restart: always
    container_name: registry
    hostname: registry
    network_mode: bridge
    ports:
      - 5000:5000
    volumes:
      - ./config.yml:/etc/docker/registry/config.yml
      - ./registry:/var/lib/registry

When I run the following command, the output is valid.

docker manifest create --insecure "10.0.0.11:5000/image:latest" "10.0.0.11:5000/image:amd64 10.0.0.11:5000/image:arm64 10.0.0.11:5000/image:armv7"
docker manifest push --insecure --purge "10.0.0.11:5000/image:latest"

## output
Created manifest list 10.0.0.11:5000/image:latest
sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

When docker-registry-ui are used

docker-compose file:

version: "3.8"
services:
  registry:
    image: registry:latest
    restart: always
    container_name: registry
    hostname: registry
    volumes:
      - ./config.yml:/etc/docker/registry/config.yml
      - ./registry:/var/lib/registry
    networks:
      - registry-ui-net

  ui:
    image: joxit/docker-registry-ui:latest
    ports:
      - 5000:5000
    container_name: registry_ui
    hostname: registry_ui
    environment:
      - REGISTRY_TITLE=My Private Docker Registry
      - NGINX_PROXY_PASS_URL=http://registry:5000
      - NGINX_LISTEN_PORT=5000
      - SINGLE_REGISTRY=true
      - DELETE_IMAGES=true
      - SHOW_CONTENT_DIGEST=true
      - NGINX_PROXY_HEADER_X_Forwarded_For=$$proxy_add_x_forwarded_for
    depends_on:
      - registry
    networks:
      - registry-ui-net

networks:
  registry-ui-net:

When I run the following command, the output is error.

docker manifest create --insecure "10.0.0.11:5000/image:latest" "10.0.0.11:5000/image:amd64 10.0.0.11:5000/image:arm64 10.0.0.11:5000/image:armv7"
docker manifest push --insecure --purge "10.0.0.11:5000/image:latest"

## output
Created manifest list 10.0.0.11:5000/image:latest
failed to configure transport: unsupported registry version

Why does this error occur? How should I modify the configuration file?

Joxit commented 2 years ago

Hi there, thank you for using my project.

I think I will need your registry server and registry ui logs

NoisyCoil commented 1 year ago

Hey there. I would like to confirm this issue and to point out that its probable cause is the lack of a header of the type

Docker-Distribution-Api-Version: registry/2.0

in the joxit/docker-registry-ui response headers. Some details can be found in the API docs. Adding the line

more_set_headers "Docker-Distribution-Api-Version: registry/2.0";

to my nginx configuration file (serving as a reverse proxy for joxit/docker-registry-ui) solved it, but perhaps it could be implemented more cleanly at the level of the container's nginx in nginx/default.conf following the API docs.