mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-04 07:33:47 +00:00
Make Docker-in-Docker the recommended and first-shown setup. Mounting the host's Docker socket gives every job root-equivalent access to the host, while DinD gives jobs their own daemon. The default `latest` tag is unchanged. Also shorten the image flavour docs to what users need to pick an image, and correct that `dind-rootless` needs `--privileged` too. Closes https://gitea.com/gitea/runner/issues/1227 --------- Co-authored-by: silverwind <2021+silverwind@noreply.gitea.com> Co-authored-by: silverwind <me@silverwind.io> Reviewed-on: https://gitea.com/gitea/runner/pulls/1258 Reviewed-by: silverwind <2021+silverwind@noreply.gitea.com> Co-authored-by: bircni <bircni@icloud.com>
15 lines
555 B
Markdown
15 lines
555 B
Markdown
### Run `gitea-runner` in a Docker Container
|
|
|
|
The recommended Docker-in-Docker image runs its own Docker daemon for jobs, so they never get the host's Docker socket:
|
|
|
|
```sh
|
|
docker run --privileged \
|
|
-e GITEA_INSTANCE_URL=http://192.168.8.18:3000 \
|
|
-e GITEA_RUNNER_REGISTRATION_TOKEN=<runner_token> \
|
|
-v "$PWD/data:/data" \
|
|
-v runner-docker:/var/lib/docker \
|
|
--name my_runner gitea/runner:nightly-dind
|
|
```
|
|
|
|
The volumes keep the runner's registration and the job image cache. See [image flavours](../../README.md#image-flavours) for alternatives.
|