Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

chore(docker): cache-mount the Go build steps in all three Dockerfiles (PIN-379)

Luigi Agostic7537c756edc
diff --git a/Dockerfile b/Dockerfile
index 59a9ddc3..6b2f3370 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -19,7 +19,7 @@ RUN go mod download
COPY . .
COPY --from=dashboard /build/dist/ internal/dashboard/dashboard/
RUN mv internal/dashboard/dashboard/index.html internal/dashboard/dashboard/dashboard.html
-RUN go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab
+RUN --mount=type=cache,target=/root/.cache/go-build go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab
# Stage 3: Minimal runtime image with Chromium.
# Only the compiled binary and entrypoint script are copied in.
diff --git a/tests/e2e/runner-cli/Dockerfile b/tests/e2e/runner-cli/Dockerfile
index 49766b87..d0c8a3dd 100644
--- a/tests/e2e/runner-cli/Dockerfile
+++ b/tests/e2e/runner-cli/Dockerfile
@@ -16,10 +16,10 @@ RUN go mod download
# Copy full source and build the CLI binary
COPY . .
-RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/pinchtab ./cmd/pinchtab
+RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/pinchtab ./cmd/pinchtab
# Library-mode example program, exercised by the library-mode smoke scenario
-RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/enrich-example ./docs/examples/enrich
+RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/enrich-example ./docs/examples/enrich
# ── Runner image ──────────────────────────────────────────────────────────────
FROM alpine:3.23
diff --git a/tests/tools/docker/cloakbrowser-smoke.Dockerfile b/tests/tools/docker/cloakbrowser-smoke.Dockerfile
index 1dae649e..e943911e 100644
--- a/tests/tools/docker/cloakbrowser-smoke.Dockerfile
+++ b/tests/tools/docker/cloakbrowser-smoke.Dockerfile
@@ -22,7 +22,7 @@ RUN go mod download
COPY . .
COPY --from=dashboard /build/dist/ internal/dashboard/dashboard/
RUN mv internal/dashboard/dashboard/index.html internal/dashboard/dashboard/dashboard.html
-RUN go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab
+RUN --mount=type=cache,target=/root/.cache/go-build go build -ldflags="-s -w" -o pinchtab ./cmd/pinchtab
# Stage 3: Download CloakBrowser through its official Python package.
FROM python:3.12-slim AS cloakbrowser-binary