Commit 0f713b0f authored by Steve Abrams's avatar Steve Abrams Committed by Suzanne Selhorn

Add section to the dependency proxy docs detailing CI authentication

parent d1b77d04
......@@ -106,6 +106,50 @@ dependency-proxy-pull-master:
You can also use [custom environment variables](../../../ci/variables/README.md#custom-environment-variables) to store and access your personal access token or other valid credentials.
##### Authenticate with `DOCKER_AUTH_CONFIG`
You can use the Dependency Proxy to pull your base image.
1. [Create a `DOCKER_AUTH_CONFIG` environment variable](../../../ci/docker/using_docker_images.md#define-an-image-from-a-private-container-registry).
1. Get credentials that allow you to log into the Dependency Proxy.
1. Generate the version of these credentials that will be used by Docker:
```shell
# The use of "-n" - prevents encoding a newline in the password.
echo -n "my_username:my_password" | base64
# Example output to copy
bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ=
```
This can also be other credentials such as:
```shell
echo -n "my_username:personal_access_token" | base64
echo -n "deploy_token_username:deploy_token" | base64
```
1. Create a [custom environment variables](../../../ci/variables/README.md#custom-environment-variables)
named `DOCKER_AUTH_CONFIG` with a value of:
```json
{
"auths": {
"https://gitlab.example.com": {
"auth": "(Base64 content from above)"
}
}
}
```
1. Now reference the Dependency Proxy in your base image:
```yaml
# .gitlab-ci.yml
image: "$CI_SERVER_HOST":"$CI_SERVER_PORT"/groupname/dependency_proxy/containers/node:latest
...
```
### Store a Docker image in Dependency Proxy cache
To store a Docker image in Dependency Proxy storage:
......
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