Commit c9698236 authored by Tim Rizzi's avatar Tim Rizzi Committed by Nick Gaskill

Add pull by digest example to the dependency proxy

parent c0075c3c
...@@ -94,9 +94,11 @@ Runners log in to the Dependency Proxy automatically. To pull through ...@@ -94,9 +94,11 @@ Runners log in to the Dependency Proxy automatically. To pull through
the Dependency Proxy, use the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX` the Dependency Proxy, use the `CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`
[predefined CI/CD variable](../../../ci/variables/predefined_variables.md): [predefined CI/CD variable](../../../ci/variables/predefined_variables.md):
Example pulling the latest alpine image:
```yaml ```yaml
# .gitlab-ci.yml # .gitlab-ci.yml
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:latest image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest
``` ```
There are other additional predefined CI/CD variables you can also use: There are other additional predefined CI/CD variables you can also use:
...@@ -124,13 +126,20 @@ To store a Docker image in Dependency Proxy storage: ...@@ -124,13 +126,20 @@ To store a Docker image in Dependency Proxy storage:
1. Go to your group's **Packages & Registries > Dependency Proxy**. 1. Go to your group's **Packages & Registries > Dependency Proxy**.
1. Copy the **Dependency Proxy URL**. 1. Copy the **Dependency Proxy URL**.
1. Use one of these commands. In these examples, the image is `alpine:latest`. 1. Use one of these commands. In these examples, the image is `alpine:latest`.
1. You can also pull images by digest to specify exactly which version of an image to pull.
- Add the URL to your [`.gitlab-ci.yml`](../../../ci/yaml/README.md#image) file: - Pull an image by tag by adding the image to your [`.gitlab-ci.yml`](../../../ci/yaml/README.md#image) file:
```shell ```shell
image: gitlab.example.com/groupname/dependency_proxy/containers/alpine:latest image: gitlab.example.com/groupname/dependency_proxy/containers/alpine:latest
``` ```
- Pull an image by digest by adding the image to your [`.gitlab-ci.yml`](../../../ci/yaml/README.md#image) file:
```shell
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine@sha256:c9375e662992791e3f39e919b26f510e5254b42792519c180aad254e6b38f4dc
```
- Manually pull the Docker image: - Manually pull the Docker image:
```shell ```shell
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment