diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 21:09:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-05 21:09:44 +0300 |
commit | a83bc624e4d040e52a66633156e9120a45bbefe5 (patch) | |
tree | 8f8bbec7750b378b9173b78c83cdf01dd5341d0a /doc/user/packages/dependency_proxy | |
parent | 4046c3447e0a01fe48e224e72e12b27859b92822 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/packages/dependency_proxy')
-rw-r--r-- | doc/user/packages/dependency_proxy/index.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/user/packages/dependency_proxy/index.md b/doc/user/packages/dependency_proxy/index.md index fd75df513c7..878354ab264 100644 --- a/doc/user/packages/dependency_proxy/index.md +++ b/doc/user/packages/dependency_proxy/index.md @@ -221,3 +221,19 @@ RateLimit-Remaining: 98;w=21600 ``` This example shows the total limit of 100 pulls in six hours, with 98 pulls remaining. + +#### Check the rate limit in a CI/CD job + +This example shows a GitLab CI/CD job that uses an image with `jq` and `curl` installed: + +```yaml +hub_docker_quota_check: + stage: build + image: alpine:latest + tags: + - <optional_runner_tag> + before_script: apk add curl jq + script: + - | + TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq --raw-output .token) && curl --head --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" 2>&1 +``` |