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

'Proxy Cache' without '<harbor_server_name>/<proxy_project_name>' prefix? #21339

Open
rogerfydp opened this issue Dec 19, 2024 · 4 comments
Open
Assignees
Labels
icebox kind/requirement New feature or idea on top of harbor

Comments

@rogerfydp
Copy link

We are currently using [distribution](https://github.com/distribution/distribution) to cache Docker images from external repositories. In our setup, distribution is deployed on 10.0.0.50:5000. To use this setup in our Docker environments, we modify the Docker daemon configuration as follows:

"insecure-registries": [
    "http://10.0.0.50:5000"
],
"registry-mirrors": [
    "http://10.0.0.50:5000"
]

This setup works perfectly for us because we can continue referencing images in our docker-compose files or equivalent with the original Docker Hub image names, without requiring any prefixes.

For example:

services:
  app:
    image: nginx:latest

Now, we are considering migrating entirely to Harbor. However, based on the [Harbor documentation](https://goharbor.io/docs/2.1.0/administration/configure-proxy-cache/), it states:

To start using the proxy cache, configure your Docker pull commands or pod manifests to reference the proxy cache project by adding <harbor_servername>/<proxy_project_name>/ as a prefix to the image tag. For example:

docker pull <harbor_server_name>/<proxy_project_name>/goharbor/harbor-core:dev

While this approach works, it requires us to modify all docker-compose files or equivalent to include the <harbor_server_name>/<proxy_project_name>/ prefix, as shown:

services:
  app:
    image: <harbor_server_name>/<proxy_project_name>/nginx:latest

This introduces additional complexity for us.

Question:
Is there a recommended way in Harbor to achieve the same simple setup as we currently have with distribution, where we can continue referencing images without prefixes (e.g., just nginx:latest) while using Harbor's proxy cache functionality?

If not, is this feature planned or possible with custom configuration?

@ianseyer
Copy link

ianseyer commented Dec 19, 2024

If I am understanding this correctly, we would like the same feature.

for example, if we have an upstream proxied registry that contains repository a, it would be nice to be able to pull the image located at a/b/c:latest via this proxy project by hitting harbor.com/a/b/c:latest rather than harbor.com/a/a/b/c:latest

EDIT: upon re-reading your issue, I do not believe this is possbile: the registry is a part of the tag. The docker client does not support changing the default registry from dockerhub.

@wy65701436 wy65701436 added the kind/requirement New feature or idea on top of harbor label Dec 23, 2024
@stonezdj
Copy link
Contributor

Proxy cache in Harbor differs from registry-mirrors in distribution, do you have many applications run with docker-compose?

@reasonerjt
Copy link
Contributor

EDIT: upon re-reading your issue, I do not believe this is possbile: the registry is a part of the tag. The docker client does not support changing the default registry from dockerhub.

I think this is correct, it won't be possible without changing the code at client-side.

@Vad1mo
Copy link
Member

Vad1mo commented Dec 23, 2024

duplicate of #21342

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
icebox kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests

6 participants