Files
upaas/Dockerfile
clawbot 5d3e0667de
All checks were successful
Check / check (pull_request) Successful in 1m46s
fix: add COPY --from=lint to builder stage to force lint execution
BuildKit skips unreferenced stages silently. The lint stage was never
referenced by the builder stage via COPY --from, so it was being skipped
entirely during docker build. This adds a stage dependency that forces
the lint stage to complete before the build proceeds.

closes #153
2026-03-01 14:28:21 -08:00

50 lines
1.1 KiB
Docker

# Lint stage — fast feedback on formatting and lint issues
# golangci/golangci-lint:v2.10.1
FROM golangci/golangci-lint@sha256:ea84d14c2fef724411be7dc45e09e6ef721d748315252b02df19a7e3113ee763 AS lint
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make fmt-check
RUN make lint
# Build stage — tests and compilation
# golang:1.25-alpine
FROM golang@sha256:f6751d823c26342f9506c03797d2527668d095b0a15f1862cddb4d927a7a4ced AS builder
# Force BuildKit to run the lint stage by creating a stage dependency
COPY --from=lint /src/go.sum /dev/null
RUN apk add --no-cache git make gcc musl-dev
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make test
RUN make build
# Runtime stage
# alpine:3.19
FROM alpine@sha256:6baf43584bcb78f2e5847d1de515f23499913ac9f12bdf834811a3145eb11ca1
RUN apk add --no-cache ca-certificates tzdata git openssh-client docker-cli
WORKDIR /app
COPY --from=builder /src/bin/upaasd /app/upaasd
# Create data directory
RUN mkdir -p /var/lib/upaas
ENV UPAAS_DATA_DIR=/var/lib/upaas
EXPOSE 8080
ENTRYPOINT ["/app/upaasd"]