fix(ci): use explicit container: block for reliable job-level docker options
Some checks failed
build-and-release / build (push) Failing after 16s

Forgejo's docs note --add-host via the runner's global
container.options config is not reliably honored for jobs using pure
label-based runs-on mapping. Setting the same image + options
explicitly per-job via jobs.build.container is the more directly
supported path for per-job container customization.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-07 22:45:35 +05:30
parent b9e0ba247c
commit dcf573e0f6

View file

@ -13,12 +13,16 @@ concurrency:
jobs: jobs:
build: build:
runs-on: docker-ready runs-on: docker-ready
# Explicit container: (rather than relying only on the docker-ready
# label mapping) so job-level container options are reliably honored.
container:
image: ci.nxtgauge.com/admin/forgejo-runner-job:bookworm
options: --add-host=host.docker.internal:host-gateway
env: env:
# 127.0.0.1 doesn't work here: the job container is nested one level # 127.0.0.1 doesn't work here: the job container is nested one level
# inside the runner pod's dind sidecar, so its own loopback isn't the # inside the runner pod's dind sidecar, so its own loopback isn't the
# sidecar's. host.docker.internal (mapped via --add-host in the # sidecar's. host.docker.internal (mapped via --add-host above)
# runner's container.options) reaches back to the dind engine that # reaches back to the dind engine that actually spawned this container.
# actually spawned this container.
DOCKER_HOST: tcp://host.docker.internal:2375 DOCKER_HOST: tcp://host.docker.internal:2375
DOCKER_BUILDKIT: "1" DOCKER_BUILDKIT: "1"
steps: steps: