From 66036cd301969700cfdc840c92dccee633381a47 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 9 Sep 2024 12:07:47 +0100 Subject: [PATCH] Stop using DIND for CI Seems to not play nicely with LXC, and given it runs in its own container already, it's probably fine. --- .../forgejo_runner/files/docker-compose.yml | 29 ++++++++++++++----- ansible/roles/forgejo_runner/tasks/main.yml | 10 +------ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ansible/roles/forgejo_runner/files/docker-compose.yml b/ansible/roles/forgejo_runner/files/docker-compose.yml index 976deb3..124d085 100644 --- a/ansible/roles/forgejo_runner/files/docker-compose.yml +++ b/ansible/roles/forgejo_runner/files/docker-compose.yml @@ -4,17 +4,32 @@ services: user: "{{ docker_user.id }}" volumes: - /mnt/data:/data + - ./config.yml:/data/config.yml environment: - TZ={{ timezone }} - - DOCKER_HOST=tcp://dind:2375 + - DOCKER_HOST=tcp://docker_proxy:2375 restart: unless-stopped command: forgejo-runner daemon depends_on: - dind: - condition: service_started + - docker_proxy - dind: - image: docker:dind - privileged: true - command: [dockerd, -H, tcp://0.0.0.0:2375, --tls=false] + docker_proxy: + image: lscr.io/linuxserver/socket-proxy:latest restart: unless-stopped + environment: + - POST=1 + - CONTAINERS=1 + - INFO=1 + - IMAGES=1 + - VOLUMES=1 + - NETWORKS=1 + - ALLOW_START=1 + - ALLOW_STOP=1 + - ALLOW_RESTARTS=1 + - EXEC=1 + tmpfs: + - /run + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + logging: + driver: none diff --git a/ansible/roles/forgejo_runner/tasks/main.yml b/ansible/roles/forgejo_runner/tasks/main.yml index 820d148..a49f432 100644 --- a/ansible/roles/forgejo_runner/tasks/main.yml +++ b/ansible/roles/forgejo_runner/tasks/main.yml @@ -6,18 +6,10 @@ mode: "{{ docker_compose_directory_mask }}" become: true -- name: Create data directory - file: - path: /opt/forgejo-runner/data - state: directory - mode: "700" - owner: "{{ docker_user.name }}" - become: true - - name: Install config file template: src: files/config.yml - dest: /opt/forgejo-runner/data/config.yml + dest: /opt/forgejo-runner/config.yml mode: "600" owner: "{{ docker_user.name }}" notify: restart forgejo-runner