debian-mirror-gitlab/doc/user/packages/dependency_proxy/index.md

88 lines
3.2 KiB
Markdown
Raw Normal View History

2020-06-23 00:09:42 +05:30
---
stage: Package
group: Package
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
2020-10-24 23:57:45 +05:30
# Dependency Proxy **(PREMIUM)**
2019-12-04 20:38:33 +05:30
2020-10-24 23:57:45 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7934) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.11.
2019-12-04 20:38:33 +05:30
NOTE: **Note:**
This is the user guide. In order to use the dependency proxy, an administrator
must first [configure it](../../../administration/packages/dependency_proxy.md).
For many organizations, it is desirable to have a local proxy for frequently used
upstream images/packages. In the case of CI/CD, the proxy is responsible for
receiving a request and returning the upstream image from a registry, acting
as a pull-through cache.
The dependency proxy is available in the group level. To access it, navigate to
2020-05-24 23:13:21 +05:30
a group's **Packages & Registries > Dependency Proxy**.
2019-12-04 20:38:33 +05:30
![Dependency Proxy group page](img/group_dependency_proxy.png)
## Supported dependency proxies
NOTE: **Note:**
For a list of the upcoming additions to the proxies, visit the
[direction page](https://about.gitlab.com/direction/package/dependency_proxy/#top-vision-items).
The following dependency proxies are supported.
| Dependency proxy | GitLab version |
| ---------------- | -------------- |
| Docker | 11.11+ |
## Using the Docker dependency proxy
With the Docker dependency proxy, you can use GitLab as a source for a Docker image.
To get a Docker image into the dependency proxy:
2020-05-24 23:13:21 +05:30
1. Find the proxy URL on your group's page under **Packages & Registries > Dependency Proxy**,
2019-12-04 20:38:33 +05:30
for example `gitlab.com/groupname/dependency_proxy/containers`.
1. Trigger GitLab to pull the Docker image you want (e.g., `alpine:latest` or
`linuxserver/nextcloud:latest`) and store it in the proxy storage by using
one of the following ways:
- Manually pulling the Docker image:
2020-03-13 15:44:24 +05:30
```shell
2019-12-04 20:38:33 +05:30
docker pull gitlab.com/groupname/dependency_proxy/containers/alpine:latest
```
- From a `Dockerfile`:
2020-03-13 15:44:24 +05:30
```shell
2019-12-04 20:38:33 +05:30
FROM gitlab.com/groupname/dependency_proxy/containers/alpine:latest
```
- In [`.gitlab-ci.yml`](../../../ci/yaml/README.md#image):
2020-03-13 15:44:24 +05:30
```shell
2019-12-04 20:38:33 +05:30
image: gitlab.com/groupname/dependency_proxy/containers/alpine:latest
```
2020-10-24 23:57:45 +05:30
GitLab pulls the Docker image from Docker Hub and caches the blobs
on the GitLab server. The next time you pull the same image, GitLab gets the latest
information about the image from Docker Hub but serves the existing blobs
from the GitLab server.
2019-12-04 20:38:33 +05:30
The blobs are kept forever, and there is no hard limit on how much data can be
stored.
2020-04-22 19:07:51 +05:30
## Clearing the cache
It is possible to use the GitLab API to purge the dependency proxy cache for a
given group to gain back disk space that may be taken up by image blobs that
are no longer needed. See the [dependency proxy API documentation](../../../api/dependency_proxy.md)
for more details.
2019-12-04 20:38:33 +05:30
## Limitations
The following limitations apply:
2020-10-24 23:57:45 +05:30
- Only [public groups are supported](https://gitlab.com/gitlab-org/gitlab/-/issues/11582) (authentication is not supported yet).
2019-12-04 20:38:33 +05:30
- Only Docker Hub is supported.
- This feature requires Docker Hub being available.