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

Unable to delete docker image and view history #207

Closed
EverettSy opened this issue Sep 10, 2021 · 2 comments
Closed

Unable to delete docker image and view history #207

EverettSy opened this issue Sep 10, 2021 · 2 comments
Milestone

Comments

@EverettSy
Copy link

#204
1631294199237

image

config.yml

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: ['http://47.97.156.67:8280']
    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
    Access-Control-Allow-Headers: ['Authorization', 'Accept']
    Access-Control-Max-Age: [1728000]
    Access-Control-Allow-Credentials: [true]
    Access-Control-Expose-Headers: ['Docker-Content-Digest']
auth:
  htpasswd:
    realm: basic-realm
    path: /etc/docker/registry/auth/htpasswd
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3

docker-compose.yaml

# docker-compose.yaml
version: '3'

services:
  registry:
    image: registry:latest
    restart: always
    ports:
    - 5000:5000
    container_name: registry2
    environment:
      REGISTRY_AUTH: htpasswd
      REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
      REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
      REGISTRY_STORAGE_DELETE_ENABLED: 'true'
    volumes:
      - /etc/docker/registry/data:/var/lib/registry
      - /etc/docker/registry/auth:/auth
      - /etc/docker/registry/config.yml:/etc/docker/registry/config.yml
    networks:
      - registry-net

  ui:
    image: joxit/docker-registry-ui:latest
    restart: always
    container_name: registry-ui
    environment:
      - REGISTRY_TITLE=Private Docker Registry
      - REGISTRY_URL=http://47.97.156.67:5000
      - DELETE_IMAGES=true
      - SINGLE_REGISTRY=false
    ports:
      - '8280:80'
    depends_on:
      - registry
    networks:
      - registry-net

networks:
  registry-net:
@spkane
Copy link

spkane commented Sep 12, 2021

This is likely the same issue as #204, which I am also experiencing.

@Joxit
Copy link
Owner

Joxit commented Sep 13, 2021

Hi there,

Thank you for your issue and using my project. Checkout the FAQ

TLDR;
This is a docker registry miss-configuration of OPTIONS requests, the registry server MUST return 200 status codes on OPTIONS, but did not.

Solution 1: Use the UI as proxy, you should not have CORS errors... (use NGINX_PROXY_PASS_URL)
Solution 2: Override OPTIONS responses on the proxy where your docker registry is hosted. You will need to return 200 status code with all correct headers (those of your docker registry)

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

3 participants