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

[HELP] Can't get it to work using simple configuration #398

Open
Lolozendev opened this issue Oct 2, 2024 · 2 comments
Open

[HELP] Can't get it to work using simple configuration #398

Lolozendev opened this issue Oct 2, 2024 · 2 comments

Comments

@Lolozendev
Copy link

Hi, I'm trying to setup docker register ui but always fall on CORS errors , and I can't seem to find why.

I have this docker compose config:

services:
  registry:
    ports:
      - 5000:443
    restart: always
    container_name: my-registry
    image: registry:latest
    volumes:
      - ./registry:/var/lib/registry
      - ./certs:/certs
      - ./auth:/auth
      - ./registry_config/simple.yml:/etc/docker/registry/config.yml
  registry-ui:
    restart: always
    ports:
      - 80:80
    image: joxit/docker-registry-ui:main
    environment:
      - SINGLE_REGISTRY=true
      - REGISTRY_TITLE=My Docker Registry UI
      - DELETE_IMAGES=true
      - REGISTRY_URL=https://192.168.0.10:5000
      - SHOW_CONTENT_DIGEST=true
      - REGISTRY_SECURED=true
    container_name: my-registry-ui
    depends_on:
      - registry
networks: {}

I'm using self signed certificate for my registry. And here is my registry config

version: 0.1
log:
  fields:
    service: registry
storage:
  delete:
    enabled: true
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :443
  tls:
    certificate: /certs/localhost.crt
    key: /certs/localhost.key
  headers:
    X-Content-Type-Options: [nosniff]
    Access-Control-Allow-Origin: ['https://192.168.0.10:5000']
    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
    Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']
    Access-Control-Max-Age: [1728000]
    Access-Control-Allow-Credentials: [true]
    Access-Control-Expose-Headers: ['Docker-Content-Digest']
auth:
  htpasswd:
    realm: basic-realm
    path: /auth/htpasswd

When I try to connect to my registry through command line it works:

curl --user 'Admin:SuperPassword' -Lk https://192.168.0.10:5000/v2/_catalog
{"repositories":["testimage"]}

But when going on http://192.168.0.10 I get the error The 'Access-Control-Allow-Credentials' header in the response is missing and must be set to 'true' when the request's credentials mode is on. Origin 'https://192.168.0.10:5000' is therefore not allowed access.

Can you help me understand what I'm doing wrong please ?

@Joxit
Copy link
Owner

Joxit commented Oct 19, 2024

Is this happening on an OPTIONS request ?

@Lolozendev
Copy link
Author

I get this

image

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

2 participants