fix(gitea): runner config for caching 3

This commit is contained in:
2026-08-24 11:08:48 +02:00
parent 5b00a9809d
commit 6353f662fa
2 changed files with 21 additions and 24 deletions
+8 -10
View File
@@ -74,16 +74,6 @@ services:
GITEA_RUNNER_NAME: docker-runner GITEA_RUNNER_NAME: docker-runner
GITEA_RUNNER_LABELS: ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04 GITEA_RUNNER_LABELS: ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
DOCKER_HOST: unix:///var/run/docker.sock DOCKER_HOST: unix:///var/run/docker.sock
ports:
# Fixed cache-server port (see runner-config.yaml's cache.port) so
# job containers - isolated on their own per-task Docker network,
# unreachable via container name regardless of the `network` setting
# below - can still reach it via host.docker.internal, which resolves
# to their own network's gateway and routes back to this published
# port. Exposed on the VPS's public interface too; consider a
# firewall rule restricting it to Docker's private bridge ranges
# (172.16.0.0/12) if that's a concern.
- "8088:8088"
volumes: volumes:
- ../.data/gitea/runner:/data - ../.data/gitea/runner:/data
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
@@ -91,6 +81,11 @@ services:
restart: always restart: always
networks: networks:
- compose_network - compose_network
# Job containers join Docker's real "bridge" network (see
# runner-config.yaml's container.network) - this container needs to be
# on it too so its auto-detected cache-server address is one they can
# actually reach.
- default_bridge
db: db:
image: postgres:16-alpine image: postgres:16-alpine
container_name: gitea_db container_name: gitea_db
@@ -112,3 +107,6 @@ networks:
compose_network: compose_network:
name: ${NETWORK_NAME} name: ${NETWORK_NAME}
external: true external: true
default_bridge:
name: bridge
external: true
+13 -14
View File
@@ -15,24 +15,23 @@ runner:
cache: cache:
enabled: true enabled: true
dir: "" dir: ""
# "gitea_runner" (relying on shared networking via container.network below) # Leave empty for auto-detection - it correctly finds gitea_runner's own
# didn't work - job containers get their own auto-created per-task network # address once job containers actually share a network with it (see
# regardless of container.network (a known act_runner limitation, confirmed # container.network below; a custom network name didn't work, but Docker's
# by inspecting a live job container: it was never attached to falcon_network # real default "bridge" network does).
# at all). host.docker.internal resolves to that per-task network's own host: ""
# gateway instead, which *does* route back to this container's published port: 0
# port on the host - see https://docs.gitea.com/runner/cache/.
host: "host.docker.internal"
port: 8088
external_server: "" external_server: ""
container: container:
network: "" # A custom network name (e.g. falcon_network) was silently ignored - job
# containers still got their own isolated per-task network regardless.
# "bridge" (Docker's real, always-present default network) is honored
# instead - gitea_runner joins it too (see compose.yml) so both sides can
# reach each other by container name/IP.
network: "bridge"
privileged: false privileged: false
# --add-host is what makes host.docker.internal (used for cache.host above) options: "-v /var/run/docker.sock:/var/run/docker.sock"
# resolve inside job containers on Linux - Docker only wires it up
# automatically on Docker Desktop (Mac/Windows), not here.
options: "-v /var/run/docker.sock:/var/run/docker.sock --add-host=host.docker.internal:host-gateway"
workdir_parent: "" workdir_parent: ""
valid_volumes: [] valid_volumes: []
docker_host: "" docker_host: ""