From 762b226a81e00c722c8cc03f3e5a2a5a11689573 Mon Sep 17 00:00:00 2001 From: Will Estes Date: Sun, 9 Aug 2026 20:18:19 -0400 Subject: [PATCH] CI: stop publishing a host port for the smoke-test container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runner shares the host's Docker daemon across every repo's CI jobs, so a hardcoded host port (8080) is a shared resource, not scoped to this job — that's what was actually colliding, not a leftover vu-smoke container (the previous fix's cleanup didn't help because the conflicting container wasn't named vu-smoke at all). Curl the container's own bridge IP instead, so nothing is published to the host and there's nothing to contend over. Co-Authored-By: Claude Sonnet 5 --- .gitea/workflows/deploy.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 4d5775d..c394527 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -28,17 +28,19 @@ jobs: # served correctly under the /vu/ base path" — this is that check, # run against the exact image that ships. # - # The shell runs with `-e`, so a failed curl/grep on a past run - # could skip `docker stop`/`rm` and leave vu-smoke bound to 8080, - # blocking every run after it — clean up any leftover first, - # unconditionally, rather than relying on the previous run's own - # cleanup having succeeded. + # The runner shares the host's Docker daemon, so a hardcoded host + # port (this used to be -p 8080:80) is contended across every repo's + # CI on the same host, not scoped to this job — hence the previous + # "port already allocated" failures even after cleaning up any + # leftover vu-smoke container. Curl the container's own bridge IP + # instead, so no host port is published at all. run: | docker rm -f vu-smoke 2>/dev/null || true docker build -t vu:ci . - docker run -d --name vu-smoke -p 8080:80 vu:ci + docker run -d --name vu-smoke vu:ci sleep 1 - curl -sf http://localhost:8080/ | grep -q 'vu — Divine Office' + container_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vu-smoke) + curl -sf "http://${container_ip}/" | grep -q 'vu — Divine Office' docker stop vu-smoke docker rm vu-smoke