27 lines
942 B
Docker
27 lines
942 B
Docker
# 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 . ./
|
|
RUN CGO_ENABLED=0 GOOS=linux go test -c -tags sandbox -o /out/isolation.test ./internal/isolationtest
|
|
|
|
FROM ${RUNNER_IMAGE}
|
|
|
|
COPY --from=build /out/isolation.test /opt/lincodex-runner-tests/isolation.test
|
|
COPY testdata/hostile /opt/lincodex-runner-tests/testdata/hostile
|
|
ENV RUNNER_HOSTILE_FIXTURES=/opt/lincodex-runner-tests/testdata/hostile
|
|
|
|
HEALTHCHECK NONE
|
|
ENTRYPOINT ["/opt/lincodex-runner-tests/isolation.test", "-test.v", "-test.count=1"]
|