99bdf79a63
Le binaire est statique (CGO_ENABLED=0) — scratch suffit. Seuls les certificats TLS sont copiés depuis le builder golang:1.22-alpine. Élimine le pull de docker.io/library/alpine qui déclenche le 429. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 lines
378 B
Docker
14 lines
378 B
Docker
FROM golang:1.22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o nanometrics-server .
|
|
|
|
FROM scratch
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=builder /app/nanometrics-server /nanometrics-server
|
|
VOLUME /data
|
|
EXPOSE 8080 9999/udp
|
|
CMD ["/nanometrics-server"]
|