Repository navigation
Description
User story
As a maintainer moving a job from ubuntu-latest to ci-runner, I want the job's localhost to be the instance's, so that a service the job starts in Docker (docker run -p, docker compose up, docker build --network host) is reachable at localhost:<port>, as it is on a GitHub-hosted runner.
Why
functions/cloud-config.js starts the runner container on Docker's default bridge network. The job runs in that container but drives the host's Docker daemon, so:
- a port published with
docker run -p 5432:5432 postgresis on the host's loopback, andlocalhost:5432in the job is refused; - a server the job starts itself on
127.0.0.1can't be reached bydocker build --network hostordocker run --network host, which use the host's loopback.
zae-zcm's readme-dockerfile job hit the second case. Its check serves a fake release download from the job and builds a Dockerfile against it. On ci-runner, curl in the build failed with Failed to connect to 127.0.0.1. The repo now works around it by serving the download from a host-network container, but every repo that moves a job with services will hit this.
It's the same gap the README already closes for files: /tmp and $HOME have the same paths in the container and on the host, so docker run -v works as on a GitHub-hosted runner. Host networking does the same for ports.
What it costs
- Metadata service: the launch template's
HttpPutResponseHopLimit: 1stops a bridged container from reaching IMDS. With--network hostthe job container can reach it. That protects little today:- the instance has no instance profile, so IMDS holds no AWS credentials;
- the sensitive part of the user-data is the JIT config, which the runner has already used by the time a job runs;
- every job already has the Docker socket, so it can
docker run --network host(or mount/) and get the same access anyway.
- Ports: one job per instance, so nothing else competes for them.
- Fargate: not affected; a task's containers already share
localhost.
Acceptance criteria
- The runner container starts with
--network host. - A test job publishes a port with
docker run -pand reaches it atlocalhost, and a server the job starts on127.0.0.1is reachable fromdocker build --network host. - The README's What the job gets says the job shares the instance's network, as it already does for
/tmpand$HOME. - The launch template's IMDS comment says what the hop limit still protects, or IMDS is turned off once cloud-init has read the user-data.
- The design spec (
docs/superpowers/specs/2026-11-12-ci-runner-design.md, lines 213-214) no longer says that the Docker containers a job starts can't reach the instance metadata service: it says the containers a job starts with--network hostcan.
Activity
sodre commentedon Nov 20, 2026
Agent Brief
Category: enhancement
Summary: Make a job's
localhostthe instance's, so a service a job starts in Docker is reachable atlocalhost:<port>. The instance's metadata service is turned off once the boot configuration has read the user-data, so job containers cannot reach it.Current behavior:
The runner container starts on Docker's default bridge network. A job's
localhostis therefore the runner container's own. A port published withdocker run -plands on the instance's loopback and is refused atlocalhost. A server a job starts on127.0.0.1cannot be reached fromdocker build --network host. The instance's metadata service is reachable from job containers only through a hop limit of 1, set on the launch template and described as protecting it from job containers.Desired behavior:
docker run -pis reachable atlocalhostfrom the job. A server the job starts on127.0.0.1is reachable fromdocker build --network hostanddocker run --network host.localhost.Key interfaces:
/tmpand$HOME.Acceptance criteria:
Out of scope:
docs(spec): a container started with --network host reaches the metad…
feat(runner): A job's localhost is the instance's (#54)