# DEVELOPMENT AND CI ONLY: the isolation test image. It adds the compiled # isolation tests and the hostile fixtures to a locally built runner image and # is started by make -C runner test-sandbox with the privileges that nsjail # needs inside Docker. It is never a release or production image. ARG GO_IMAGE=golang:1.26.9-alpine ARG RUNNER_IMAGE=lincodex-runner-dev:local FROM ${GO_IMAGE} AS build ENV GOTOOLCHAIN=local WORKDIR /src/runner COPY go.mod go.sum ./ RUN go mod download COPY . ./ ARG RUNNER_VERSION=unknown RUN CGO_ENABLED=0 GOOS=linux go test -c -tags sandbox \ -ldflags "-X lincodex/runner/internal/isolationtest.runnerVersion=${RUNNER_VERSION}" \ -o /out/isolation.test ./internal/isolationtest \ && CGO_ENABLED=0 GOOS=linux go test -c -tags sandbox -o /out/judge.test ./internal/judgetest FROM ${RUNNER_IMAGE} COPY --from=build /out/isolation.test /out/judge.test /opt/lincodex-runner-tests/ COPY testdata/hostile /opt/lincodex-runner-tests/testdata/hostile COPY testdata/judge /opt/lincodex-runner-tests/testdata/judge ENV RUNNER_HOSTILE_FIXTURES=/opt/lincodex-runner-tests/testdata/hostile \ RUNNER_JUDGE_FIXTURES=/opt/lincodex-runner-tests/testdata/judge HEALTHCHECK NONE # With arguments, only the A16 suite runs with them; without, both suites run. ENTRYPOINT ["/bin/sh", "-c", "set -e; if [ \"$#\" -gt 0 ]; then exec /opt/lincodex-runner-tests/isolation.test -test.v -test.count=1 \"$@\"; fi; for suite in judge isolation; do /opt/lincodex-runner-tests/$suite.test -test.v -test.count=1; done", "sandbox-test"]