From d51275e28f020d35485361f3a055c97e81f009c8 Mon Sep 17 00:00:00 2001 From: Sergio Talens-Oliag Date: Thu, 13 Mar 2025 15:05:50 +0100 Subject: [PATCH] Use sockets for dind --- .gitignore | 1 + docker-compose.yml | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8fce603..5b6a08a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ data/ +dind/ diff --git a/docker-compose.yml b/docker-compose.yml index 2527d92..8aee0ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,10 @@ services: image: docker:dind container_name: 'dind' privileged: 'true' - command: ['dockerd', '-H', 'tcp://0.0.0.0:2375', '--tls=false'] + command: ['dockerd', '-H', 'unix:///dind/docker.sock', '-G', '$RUNNER_GID'] restart: 'unless-stopped' + volumes: + - ./dind:/dind runner: image: 'data.forgejo.org/forgejo/runner:6.2.2' @@ -15,9 +17,10 @@ services: condition: service_started container_name: 'runner' environment: - DOCKER_HOST: tcp://dind:2375 + DOCKER_HOST: 'unix:///dind/docker.sock' user: $RUNNER_UID:$RUNNER_GID volumes: - ./data:/data + - ./dind:/dind restart: 'unless-stopped' command: '/bin/sh -c "sleep 5; forgejo-runner daemon"'