fix(ci): use explicit container: block for reliable job-level docker options
Some checks failed
build-and-release / build (push) Failing after 16s
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:
parent
b9e0ba247c
commit
dcf573e0f6
1 changed files with 7 additions and 3 deletions
|
|
@ -13,12 +13,16 @@ concurrency:
|
|||
jobs:
|
||||
build:
|
||||
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:
|
||||
# 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
|
||||
# sidecar's. host.docker.internal (mapped via --add-host in the
|
||||
# runner's container.options) reaches back to the dind engine that
|
||||
# actually spawned this container.
|
||||
# sidecar's. host.docker.internal (mapped via --add-host above)
|
||||
# reaches back to the dind engine that actually spawned this container.
|
||||
DOCKER_HOST: tcp://host.docker.internal:2375
|
||||
DOCKER_BUILDKIT: "1"
|
||||
steps:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue