0
0

Gitea: run act_runner using DIND

This commit is contained in:
Opnxng 2023-11-07 17:22:30 +08:00
parent c7304784b9
commit afe92e9595
3 changed files with 21 additions and 10 deletions

View File

@ -5,3 +5,11 @@
owner: 1000 owner: 1000
group: 1000 group: 1000
mode: 0755 mode: 0755
- name: Set up Docker daemon configuration file to solve DNS problems
template:
src: "conf/daemon.json.j2"
dest: "{{ docker_dir }}/runner/daemon.json"
owner: 1000
group: 1000
mode: 0755

View File

@ -2,24 +2,24 @@
version: "3" version: "3"
services: services:
runner: runner:
image: gitea/act_runner:latest image: gitea/act_runner:latest-dind-rootless
# image: gitea/act_runner:latest-dind-rootless
container_name: runner container_name: runner
restart: always restart: always
privileged: true privileged: true
volumes: volumes:
- {{ docker_dir }}/runner:/data - {{ docker_dir }}/runner:/data
- /var/run/docker.sock:/var/run/docker.sock - {{ docker_dir }}/runner/daemon.json:/home/rootless/.config/docker/daemon.json
- {{ docker_dir }}/runner/daemon.json:/etc/docker/daemon.json
# security_opt: # security_opt:
# - no-new-privileges # - no-new-privileges
environment: environment:
- PUID=1000 - PUID=1000
- PGID=1000 - PGID=1000
- TZ=Asia/Singapore - TZ=Asia/Singapore
# - DOCKER_HOST={{ docker_host }} - DOCKER_HOST={{ docker_host }}
- GITEA_INSTANCE_URL=https://git.opnxng.com - GITEA_INSTANCE_URL=https://git.opnxng.com
- GITEA_RUNNER_REGISTRATION_TOKEN="{{ gitea_runner_registration_token }}"
- GITEA_RUNNER_NAME=runner - GITEA_RUNNER_NAME=runner
- GITEA_RUNNER_REGISTRATION_TOKEN="{{ gitea_runner_registration_token }}"
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster,runner:host - GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:16-bullseye,ubuntu-22.04:docker://node:16-bullseye,ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster,runner:host
networks: networks:
- IPv4 - IPv4
@ -27,3 +27,6 @@ networks:
IPv4: IPv4:
external: external:
name: IPv4 name: IPv4
# DinD containers cannot resolve *.github.com unless daemon.json is mounted
# https://gitea.com/gitea/act_runner/issues/381#issuecomment-755182

View File

@ -1,10 +1,10 @@
setup: setup:
oracle4: oracle3:
- caddy - runner
compose: compose:
oracle4: oracle3:
- caddy - runner
# ---------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------