Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
8e4c6a0e
Commit
8e4c6a0e
authored
Jun 06, 2017
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more info on private Registry docs
parent
e6ec9413
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
16 deletions
+54
-16
doc/ci/docker/using_docker_images.md
doc/ci/docker/using_docker_images.md
+54
-16
No files found.
doc/ci/docker/using_docker_images.md
View file @
8e4c6a0e
...
@@ -140,21 +140,58 @@ that runner.
...
@@ -140,21 +140,58 @@ that runner.
## Define an image from a private Docker registry
## Define an image from a private Docker registry
Starting with GitLab Runner 0.6.0, you are able to define images located to
> **Notes:**
private registries that could also require authentication.
-
This feature requires GitLab Runner
**1.8**
or higher
-
For GitLab Runner versions
**>= 0.6, <1.8**
there was a partial
All you have to do is be explicit on the image definition in
`.gitlab-ci.yml`
.
support for using private registries, which required manual configuration
of credentials on runner's host. We recommend to upgrade your Runner to
```
yaml
at least version
**1.8**
if you want to use private registries.
image
:
my.registry.tld:5000/namespace/image:tag
-
If the repository is private you need to authenticate your GitLab Runner in the
```
registry. Learn more about how
[
GitLab Runner works in this case
][
runner-priv-reg
]
.
In the example above, GitLab Runner will look at
`my.registry.tld:5000`
for the
As an example, let's assume that you want to use the
`registry.example.com/private/image:latest`
image
`namespace/image:tag`
.
image which is private and requires you to login into a private container registry.
To configure access for
`registry.example.com`
, follow these steps:
If the repository is private you need to authenticate your GitLab Runner in the
registry. Learn how to do that on
1.
Do a
`docker login`
on your computer:
[
GitLab Runner's documentation
][
runner-priv-reg
]
.
```bash
docker login registry.example.com --username my_username --password my_password
```
1.
Copy the content of
`~/.docker/config.json`
1.
Create a [secret variable]
`DOCKER_AUTH_CONFIG`
with the content of the
Docker configuration file as the value:
```json
{
"auths": {
"registry.example.com": {
"auth": "bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ="
}
}
}
```
1.
Do a
`docker logout`
on your computer if you don't need access to the
registry from it:
```bash
docker logout registry.example.com
```
1.
You can now use any private image from
`registry.example.com`
defined in
`image`
and/or
`services`
in your
[
`.gitlab-ci.yml` file
][
yaml-priv-reg
]
:
```yaml
image: my.registry.tld:5000/namespace/image:tag
```
In the example above, GitLab Runner will look at `my.registry.tld:5000` for the
image `namespace/image:tag`.
You can add configuration for as many registries as you want, adding more
registries to the
`"auths"`
hash as described above.
## Accessing the services
## Accessing the services
...
@@ -283,4 +320,5 @@ creation.
...
@@ -283,4 +320,5 @@ creation.
[
tutum/wordpress
]:
https://hub.docker.com/r/tutum/wordpress/
[
tutum/wordpress
]:
https://hub.docker.com/r/tutum/wordpress/
[
postgres-hub
]:
https://hub.docker.com/r/_/postgres/
[
postgres-hub
]:
https://hub.docker.com/r/_/postgres/
[
mysql-hub
]:
https://hub.docker.com/r/_/mysql/
[
mysql-hub
]:
https://hub.docker.com/r/_/mysql/
[
runner-priv-reg
]:
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/configuration/advanced-configuration.md#using-a-private-docker-registry
[
runner-priv-reg
]:
http://docs.gitlab.com/runner/configuration/advanced-configuration.html#using-a-private-container-registry
[
secret variable
]:
../variables/README.md#secret-variables
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment