Files
simplelog/Dockerfile
T
clawbot cb74aa593d
check / check (push) Failing after 3s
Format Markdown with prettier in make fmt (closes #43)
script/fmt and script/fmt-check now run prettier on every Markdown file
after their Go steps, as the standard scripts from sneak/prompts at
dd4027b do. script/bootstrap gains the standard node, nvm and yarn
install next to its goimports install, and the last Dockerfile stage
copies package.json and yarn.lock before running it. .prettierrc,
.prettierignore and yarn.lock are the standard copies. package.json is
the standard one without its licence field and marked private, because
this repo's licence is the WTFPL. .dockerignore keeps the log of a failed
yarn install out of the build context. README.md and TODO.md are
reformatted once with it; REPO_POLICIES.md already matched.

Model: opus-5-5
2026-10-06 16:22:56 +02:00

37 lines
1.5 KiB
Docker

# Lint stage. The format check is not here: it runs on the host, in
# script/fmt-check.
# golangci/golangci-lint:v2.14.0 (Debian-based), 2026-09-24
FROM golangci/golangci-lint@sha256:ad862ba6b3798cbe0fd9fd7408d498fd74fbd2623a92406b2fd3898faf0bf98f AS lint
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Called directly: make lint is itself a docker build of this stage.
RUN golangci-lint run --config .golangci.yml ./...
# Test stage: run full test suite under the race detector
# golang 1.22.12 (Debian-based; -race needs its C toolchain), 2025-02-04
FROM golang@sha256:1cf6c45ba39db9fd6db16922041d074a63c935556a05c5ccb62d181034df7f02 AS test
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Called directly: make test is itself a docker build of this stage.
RUN go test -timeout 90s -race -cover ./... || \
{ echo "--- Rerunning with -v for details ---"; \
go test -timeout 90s -race -v ./...; exit 1; }
# Final stage: a development environment, set up by script/bootstrap.
# The copies make a plain docker build run both stages above. No stage
# compiles a binary, since simplelog is a library, so none declares the
# VERSION build argument that script/docker and script/cibuild pass.
# golang 1.22.12 (2025-02-04)
FROM golang@sha256:1cf6c45ba39db9fd6db16922041d074a63c935556a05c5ccb62d181034df7f02
COPY --from=lint /src/go.sum /dev/null
COPY --from=test /src/go.sum /dev/null
WORKDIR /src
COPY script/ script/
COPY go.mod go.sum package.json yarn.lock ./
RUN script/bootstrap
COPY . .