Skip to content

Docker Package Registry not working with sub directory? #21092

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

Closed
Rincewind34 opened this issue Sep 6, 2022 · 6 comments · Fixed by #27505
Closed

Docker Package Registry not working with sub directory? #21092

Rincewind34 opened this issue Sep 6, 2022 · 6 comments · Fixed by #27505
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea topic/packages

Comments

@Rincewind34
Copy link

Description

According to this documentation: https://docs.gitea.io/en-us/packages/container/ I think it is not possible to use the package registry with docker, if GitEa is running in a sib directory as in "example.com/gitea".

Is this something that one can bypass by altering the docker push command?

Gitea Version

1.17.1

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Hosted with Docker without subdomain but with sub directory under https://mydomain.com/gitea

Database

No response

@mlarabi
Copy link

mlarabi commented Sep 6, 2022

Use a reverse proxy (nginx for example) to rewrite the URL by removing the static part before passing it to your Gitea instance.

@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 6, 2022

That's not a Gitea limitation. The docker api needs the /v2/ endpoint.

@KN4CK3R KN4CK3R added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea topic/packages and removed type/bug labels Sep 6, 2022
@Rincewind34
Copy link
Author

Thanks for the feedback! I'll be trying the proxy tomorrow with a colleague. But I did a little digging and it seems to me that this can (and should?) be configured on the server side using the prefix setting: https://docs.docker.com/registry/configuration/#http

@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 7, 2022

The registry supports that but the/every client does not. See #18438 (comment) and the following posts for more informations.

@Rincewind34
Copy link
Author

Thanks guys! I'm no expert but I managed to get this working. Running gitea and nginx with docker compose -- add this to nginx:

    location /gitea/ { ## normal GitEA configuration
        client_max_body_size 10G;
        proxy_pass http://gitea:3000/;
    }

    location /v2/ { ## NEW, necessary for docker registry.
        client_max_body_size 10G;
        proxy_pass http://gitea:3000/v2/;
    }

@jessielw
Copy link

jessielw commented Oct 6, 2023

Thanks guys! I'm no expert but I managed to get this working. Running gitea and nginx with docker compose -- add this to nginx:

    location /gitea/ { ## normal GitEA configuration
        client_max_body_size 10G;
        proxy_pass http://gitea:3000/;
    }

    location /v2/ { ## NEW, necessary for docker registry.
        client_max_body_size 10G;
        proxy_pass http://gitea:3000/v2/;
    }

This should be added to the gitea documentation for nginx for subfolders

wxiaoguang added a commit that referenced this issue Oct 9, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea topic/packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants