showcase
- v0.2.4
- 37 commits
- 1 branch
- 6 tags
- updated
- CI 2/2
Dockerfile
1.4 KB · 33 lines
1# syntax=docker/dockerfile:123# Base images are pinned by digest. To bump: crane digest <image>:<tag>4# The build stage runs natively and cross-compiles, so multi-arch builds only5# emulate the small runtime stage.6FROM --platform=$BUILDPLATFORM golang:1.27.4-alpine3.24@sha256:70bd7ddea8b6cbe5d6943cde279d6b67feb10cc924fb9100d1d8757c1575b280 AS build7WORKDIR /src8COPY go.mod go.sum ./9RUN go mod download10COPY cmd ./cmd11COPY internal ./internal12COPY web ./web13ARG TARGETOS TARGETARCH14RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \15 go build -trimpath -ldflags="-s -w" -o /out/showcase ./cmd/showcase1617# git is needed at runtime for the mirrors, which is why this isn't distroless.18FROM alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf19# hadolint ignore=DL301820RUN apk add --no-cache git ca-certificates \21 && mkdir /data \22 && chown 10001:10001 /data23COPY --from=build /out/showcase /usr/local/bin/showcase24# the mirrors are owned by this user, so no safe.directory is needed25USER 10001:1000126ENV HOME=/data27EXPOSE 808028VOLUME /data29# /healthz is 503 until the first build is published30HEALTHCHECK --interval=30s --timeout=5s --start-period=5m \31 CMD ["wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/healthz"]32ENTRYPOINT ["/usr/local/bin/showcase"]33CMD ["-config", "/config.json", "-data", "/data", "-listen", ":8080"]