Feature proposal: Support <image-name>/tags/list API endpoint in dependency proxy

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

Situation

The GitLab dependency proxy currently supports the <image-name>/manifests and <image-name>/blobs endpoints: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/path_regex.rb#L265

Problem

To avoid the many HTTP 429 Too Many Requests responses from index.docker.io, we would like to use the GitLab Dependency proxy as docker data source registry host for renovate bot (https://docs.renovatebot.com/).

However, this is not currently possible, because GitLab dependency proxy does not support the <image-name>/tags/list endpoint.

Renovate bot uses the <image-name>/tags/list endpoint to check which new dependency versions might be present: https://github.com/renovatebot/renovate/blob/main/lib/modules/datasource/docker/index.ts#L700

The missing feature in GitLab dependency proxy causes requests such as this one to fail with HTTP 404: GET https://gitlab.<self-hosted>.io/v2/<group>/dependency_proxy/containers/<image-name>/tags/list?n=10000

Due to these failures / due to the missing feature, we need to configure docker hub as registry host for dependency updates (bypassing GitLab dependency proxy), counting each request to the docker hub rate limit.

Proposed solution

I propose adding support for proxying /tags/list in dependency proxy, making the proxy more valuable, as it would be usable for automated dependency updates.

Responses from docker hub would not necessarily need to be cached, as only requests for <image-name>/manifests, but not requests for <image-name>/tags/list are counted towards the docker hub rate limit.

However, a configurable cache lifetime for tags list responses might be helpful to offset carbon emissions.

Edited by 🤖 GitLab Bot 🤖