Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
8e4c6a0e
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8e4c6a0e
编写于
6月 06, 2017
作者:
A
Achilleas Pipinellis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add more info on private Registry docs
上级
e6ec9413
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
16 deletion
+54
-16
doc/ci/docker/using_docker_images.md
doc/ci/docker/using_docker_images.md
+54
-16
未找到文件。
doc/ci/docker/using_docker_images.md
浏览文件 @
8e4c6a0e
...
...
@@ -140,21 +140,58 @@ that runner.
## Define an image from a private Docker registry
Starting with GitLab Runner 0.6.0, you are able to define images located to
private registries that could also require authentication.
All you have to do is be explicit on the image definition in
`.gitlab-ci.yml`
.
```
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`
.
If the repository is private you need to authenticate your GitLab Runner in the
registry. Learn how to do that on
[
GitLab Runner's documentation
][
runner-priv-reg
]
.
> **Notes:**
-
This feature requires GitLab Runner
**1.8**
or higher
-
For GitLab Runner versions
**>= 0.6, <1.8**
there was a partial
support for using private registries, which required manual configuration
of credentials on runner's host. We recommend to upgrade your Runner to
at least version
**1.8**
if you want to use private registries.
-
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
]
.
As an example, let's assume that you want to use the
`registry.example.com/private/image:latest`
image which is private and requires you to login into a private container registry.
To configure access for
`registry.example.com`
, follow these steps:
1.
Do a
`docker login`
on your computer:
```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
...
...
@@ -283,4 +320,5 @@ creation.
[
tutum/wordpress
]:
https://hub.docker.com/r/tutum/wordpress/
[
postgres-hub
]:
https://hub.docker.com/r/_/postgres/
[
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录