Support for docker services in runner config
See original GitHub issueCurrently,
what I try to achieve is also to configure predinefed services for some runner. This could be done through runner/configuration/advanced-configuration.html#the-runnersdockerservices-section
So currently I don’t know how this could be achieved by using this role.
What I did try but without success was the following:
gitlab_runner_coordinator_url: "https://gitlab.example.com"
gitlab_runner_listen_address: "0.0.0.0:9097"
gitlab_runner_runners:
- name: '{{ ansible_hostname }}'
state: present
executor: docker
docker_image: 'docker:19.03-git'
tags:
- docker
- dind
env_vars: [
"DOCKER_AUTH_CONFIG={\"auths\":{\"docker.example.com\":{\"auth\":\"<my-secret>\"}},\"HttpHeaders\":{\"User-Agent\":\"Docker-client/18.09.5 (linux)\"}}",
"DOCKER_DRIVER=\"overlay2\"",
]
run_untagged: false
# Docker privileged mode
docker_privileged: true
docker_volumes:
- "/cache"
- "/etc/docker/certs.d:/etc/docker/certs.d"
- "/var/lib/docker"
extra_configs:
runners.docker:
wait_for_services_timeout: 15
runners.docker.services:
- name: "docker:19.03-dind"
I hope someone can help me. Thanks in advance.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Advanced configuration - GitLab Docs
The [runners.docker] section. The following settings define the Docker container parameters. Docker-in-Docker as a service, or any container runtime configured ...
Read more >Using docker build · Docker · Ci · Help · GitLab
To run Docker commands in your CI/CD jobs, you must configure GitLab Runner to support docker commands. Enable Docker commands in your CI/CD...
Read more >Using docker images · Docker · Ci · Help · GitLab
Configuring services. Many services accept environment variables which allow you to easily change database names or set account names depending on the ...
Read more >Docker Engine post-installation steps
Configure Docker to start on boot with systemd . Many modern Linux distributions use systemd to manage which services start when the...
Read more >About service containers - GitHub Docs
You can configure jobs in a workflow to run directly on a runner machine or in a Docker container. Communication between a job...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If your happy with the code and tested it, no reason not to make a PR for it. I have reverted PR’s in the past because of issues but that is the point of the test and its a community effort 😃
I quickly hacked something together to make this work. I say hacked as I’m not too deep into your role and I’m unsure if this is the way to go for adding that feature. However, it’s looking quite ok for a midnight development session 😃
Added my services configuration as
docker_services
togitlab_runner_runners
Created a template file
templates/config.runners.docker.services.j2
Added the following to
tasks/update-config-runner.yml
That’s it. This looks like so in my GitLab runner configuration and works quite well for my needs.