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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
14eead82
Commit
14eead82
authored
Nov 05, 2020
by
Tomasz Maczukin
Committed by
Suzanne Selhorn
Nov 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation for Kubernetes and DinD case for mirroring
parent
1403076d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
4 deletions
+54
-4
doc/ci/docker/using_docker_build.md
doc/ci/docker/using_docker_build.md
+54
-4
No files found.
doc/ci/docker/using_docker_build.md
View file @
14eead82
...
...
@@ -362,13 +362,13 @@ Kubernetes:
##### Docker executor inside GitLab Runner configuration
If you are an administrator of GitLab Runner and you
always
want to use
If you are an administrator of GitLab Runner and you want to use
the mirror for every
`dind`
service, update the
[
configuration
](
https://docs.gitlab.com/runner/configuration/advanced-configuration.html
)
to specify a
[
volume
mount
](
https://docs.gitlab.com/runner/configuration/advanced-configuration.html#volumes-in-the-runnersdocker-section
)
.
Given we have a file
`/opt/docker/daemon.json`
with the following
For example, if you have a
`/opt/docker/daemon.json`
file
with the following
content:
```
json
...
...
@@ -379,7 +379,7 @@ content:
}
```
Update the
`config.toml`
f
or GitLab Runner
to mount the file to
Update the
`config.toml`
f
ile
to mount the file to
`/etc/docker/daemon.json`
. This would mount the file for
**every**
container that is created by GitLab Runner. The configuration will be
picked up by the
`dind`
service.
...
...
@@ -394,7 +394,57 @@ picked up by the `dind` service.
volumes
=
["/opt/docker/daemon.json:/etc/docker/daemon.json:ro"]
```
### Use Docker socket binding
##### Kubernetes executor inside GitLab Runner configuration
> [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3223) in GitLab Runner 13.6.
If you are an administrator of GitLab Runner and you want to use
the mirror for every
`dind`
service, update the
[
configuration
](
https://docs.gitlab.com/runner/configuration/advanced-configuration.html
)
to specify a
[
ConfigMap volume
mount
](
https://docs.gitlab.com/runner/executors/kubernetes.html#using-volumes
)
.
For example, if you have a
`/tmp/daemon.json`
file with the following
content:
```
json
{
"registry-mirrors"
:
[
"https://registry-mirror.example.com"
]
}
```
Create a
[
ConfigMap
](
https://kubernetes.io/docs/concepts/configuration/configmap/
)
with the content
of this file. You can do this with a command like:
```
shell
kubectl create configmap docker-daemon
--namespace
gitlab-runner
--from-file
/tmp/daemon.json
```
NOTE:
**Note:**
Make sure to use the namespace that GitLab Runner Kubernetes executor uses
to create job pods in.
After the ConfigMap is created, you can update the
`config.toml`
file to mount the file to
`/etc/docker/daemon.json`
. This update
mounts the file for
**every**
container that is created by GitLab Runner.
The configuration is picked up by the
`dind`
service.
```
toml
[[runners]]
...
executor
=
"kubernetes"
[runners.kubernetes]
image
=
"alpine:3.12"
privileged
=
true
[[runners.kubernetes.volumes.config_map]]
name
=
"docker-daemon"
mount_path
=
"/etc/docker/daemon.json"
sub_path
=
"daemon.json"
```
#### Use Docker socket binding
The third approach is to bind-mount
`/var/run/docker.sock`
into the
container so that Docker is available in the context of that image.
...
...
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