-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ochorocho/task/self-hosted-runner
[TASK] Add configuration examples for self-hosted Runners
- Loading branch information
Showing
4 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docker in Docker | ||
|
||
The following example describes how to configure the GitLab Runner | ||
to use DDEV within the docker executor (DockerInDocker). | ||
|
||
* GitLab [Docker in Docker docs](https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#use-docker-in-docker) | ||
* [Enable SSL](https://about.gitlab.com/blog/2019/07/31/docker-in-docker-with-docker-19-dot-03/#configure-tls) connection | ||
* Potential [security risk described](https://docs.gitlab.com/runner/security/#usage-of-docker-executor) | ||
|
||
## GitLab Runner config.toml | ||
|
||
`/etc/gitlab-runner/config.toml`: | ||
|
||
```toml | ||
[[runners]] | ||
name = "Docker Runner" | ||
executor = "docker" | ||
# ... | ||
[runners.docker] | ||
# ... | ||
tls_verify = false | ||
services_privileged = true | ||
allowed_privileged_services = ["docker:dind"] | ||
``` | ||
|
||
## GitLab CI Job for DDEV | ||
|
||
`.gitlab-ci.yml`: | ||
|
||
```yaml | ||
stages: | ||
- testing | ||
|
||
ddev-initialize-docker: | ||
stage: testing | ||
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23 | ||
variables: | ||
# Remove "umask 0000" usage, so DDEV has permissions on the cloned repository | ||
# see https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags | ||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1 | ||
# Disable Docker SSL connection | ||
DOCKER_TLS_CERTDIR: "" | ||
# Fix "fatal: unable to access '<REPO>': Could not resolve host: <HOST>" | ||
FF_NETWORK_PER_BUILD: 0 | ||
services: | ||
- name: docker:dind | ||
when: always | ||
script: | ||
- ddev start | ||
# ... do things | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Docker in Podman | ||
|
||
The following example describes how to configure the GitLab Runner | ||
to use DDEV within the docker executor using Podman (DockerInPodman). | ||
|
||
* Configure the [Runner to use Podman](https://docs.gitlab.com/runner/executors/docker.html#use-podman-to-run-docker-commands). More details in the [forum](https://forum.gitlab.com/t/gitlab-runner-setup-with-podman/87893/2) | ||
|
||
## GitLab Runner config.toml | ||
|
||
`/etc/gitlab-runner/config.toml`: | ||
|
||
```toml | ||
[[runners]] | ||
name = "Podman Runner" | ||
executor = "docker" | ||
# ... | ||
[runners.docker] | ||
# ... | ||
tls_verify = false | ||
services_privileged = true | ||
allowed_privileged_services = ["docker:dind"] | ||
# Replace 1000 with the users id, run `id -u` to get the id | ||
host = "unix:///run/user/1000/podman/podman.sock" | ||
``` | ||
|
||
## GitLab CI Job for DDEV | ||
|
||
`.gitlab-ci.yml`: | ||
|
||
```yaml | ||
stages: | ||
- testing | ||
|
||
ddev-initialize-podman: | ||
stage: testing | ||
image: ghcr.io/ochorocho/ddev-gitlab-ci:v1.23 | ||
variables: | ||
# Remove "umask 0000" usage, so DDEV has permissions on the cloned repository | ||
# see https://docs.gitlab.com/runner/configuration/feature-flags.html#available-feature-flags | ||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: 1 | ||
# Disable Docker SSL connection | ||
DOCKER_TLS_CERTDIR: "" | ||
# Fix: "Error response from daemon: bad parameter: link is not supported" | ||
FF_NETWORK_PER_BUILD: 1 | ||
services: | ||
- name: docker:dind | ||
when: always | ||
script: | ||
- ddev start | ||
# ... do things | ||
``` |