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

Website does not load #351

Open
simpleacc opened this issue Jan 17, 2024 · 4 comments
Open

Website does not load #351

simpleacc opened this issue Jan 17, 2024 · 4 comments

Comments

@simpleacc
Copy link

simpleacc commented Jan 17, 2024

Hello,

First, thanks for this image, this is a tool that I would like to use but I have some problems with it...

This is my docker compose file:

version: '3'
services:
    registry:
        image: registry:latest
        container_name: REGISTRY-APP
        volumes:
            - ./auth:/auth
            - ./registry-data:/registry-data
        restart: unless-stopped
        environment:
            REGISTRY_AUTH: htpasswd
            REGISTRY_AUTH_HTPASSWD_REALM: Registry
            REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
            REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry-data
        networks:
            DockerVLAN:
                ipv4_address: 10.0.0.5

    registry-ui:
        image: joxit/docker-registry-ui:main
        container_name: REGISTRY-FE
        restart: unless-stopped
        environment:
            - SINGLE_REGISTRY=true
            - REGISTRY_TITLE=Docker Registry
            - DELETE_IMAGES=true
            - SHOW_CONTENT_DIGEST=true
            - NGINX_PROXY_PASS_URL=https://myregistry.com
            - SHOW_CATALOG_NB_TAGS=true
            - CATALOG_MIN_BRANCHES=1
            - CATALOG_MAX_BRANCHES=1
            - TAGLIST_PAGE_SIZE=100
            - REGISTRY_SECURED=false
            - CATALOG_ELEMENTS_LIMIT=1000
        networks:
            DockerVLAN:
                ipv4_address: 10.0.0.6

networks:
    DockerVLAN:
        external: true

Also, I have a reverse proxy with nginx with a site named myregistry.com and it redirects all from this name to 10.0.0.5:5000 (I wanted to use SSL)

The registry works fine, I can do the 'docker login' and do the push and pulls. But the registry-ui does not work. I can use it with http://myregistry-fe.com (it's behind reverse proxy too), the web site loads for some minutes and then a popup appears with:

<!DOCTYPE html> <html> <head> <title>Error</title> <style> html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>An error occurred.</h1> <p>Sorry, the page you are looking for is currently unavailable.<br/> Please try again later.</p> <p>If you are the system administrator of this resource then you should check the error log for details.</p> <p><em>Faithfully yours, nginx.</em></p> </body> </html>

Could you please help me with this?

@simpleacc
Copy link
Author

simpleacc commented Jan 17, 2024

Ok, an update. I have changed the UI compose with:

    registry-ui:
        image: joxit/docker-registry-ui:main
        container_name: REGISTRY-FE
        restart: unless-stopped
        environment:
            - SINGLE_REGISTRY=true
            - REGISTRY_TITLE=Docker Registry
            - DELETE_IMAGES=true
            - SHOW_CONTENT_DIGEST=true
            - REGISTRY_URL=myregistry.com
            - SHOW_CATALOG_NB_TAGS=true
            - CATALOG_MIN_BRANCHES=1
            - CATALOG_MAX_BRANCHES=1
            - TAGLIST_PAGE_SIZE=100
            - REGISTRY_SECURED=false
            - CATALOG_ELEMENTS_LIMIT=1000
        networks:
            DockerVLAN:
                ipv4_address: 10.0.0.6

Now I have more info about this. I think it is related with the user auth.
The website loads and appears an error that says:

404
CATALOG_NOT_FOUND
We received a 404 status code from your registry.

The contact point was myregistry.com/v2/_catalog?n=1000

This may be caused by a misconfiguration of Docker Registry UI. Check the [FAQ](https://joxit.dev/docker-registry-ui/#faq) and [Available options](https://joxit.dev/docker-registry-ui/#available-options)

My registry uses username and passowrd. If I go to "myregistry.com/v2/_catalog?n=1000" chrome asks me for user and password, I type them and I can see the catalog. But the registry-fe does not ask for username and password. So I assume there is the problem.

How can I fix it?

@Joxit
Copy link
Owner

Joxit commented Jan 24, 2024

Hi, thank you for using my project and submitting issues.

You are miss-configuring the Docker Registry UI, please refer the documentation: https://github.com/Joxit/docker-registry-ui?tab=readme-ov-file#available-options

  • REGISTRY_URL: The default url of your docker registry. You may need CORS configuration on your registry. This is usually the domain name or IP of your registry reachable by your computer (e.g http://registry.example.com). (default: derived from the hostname of your UI).
  • NGINX_PROXY_PASS_URL: Update the default Nginx configuration and set the proxy_pass to your backend docker registry (this avoid CORS configuration). This is usually the name of your registry container in the form http://registry:5000. Since 2.0.0

@simpleacc
Copy link
Author

Hello,

Thanks for the answer, I have done the changes and now I have another error:

An error occured: Check your connection and your registry must have Access-Control-Allow-Origin header set to http://10.0.0.6

I have added it:

services:
    registry:
        image: registry:latest
        container_name: REGISTRY-APP
        hostname: REGISTRY-APP
        #ports:
        #    - "5000:5000"
        volumes:
            - ./auth:/auth
            - ./registry-data:/registry-data
        restart: unless-stopped
        environment:
            REGISTRY_AUTH: htpasswd
            REGISTRY_AUTH_HTPASSWD_REALM: Registry
            REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
            REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /registry-data
            REGISTRY_HTTP_HEADERS_Access-Control-Allow-Origin: http://10.0.0.6

But it is still failing with the same error...

@Joxit
Copy link
Owner

Joxit commented Apr 5, 2024

If you are using NGINX_PROXY_PASS_URL you should not have this message... Can I have your browser console messages ?

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