mirror of
https://github.com/renorris/openfsd
synced 2026-03-22 06:25:35 +08:00
28 lines
577 B
Plaintext
28 lines
577 B
Plaintext
LABEL org.opencontainers.image.source=https://github.com/renorris/openfsd
|
|
|
|
FROM golang:1.24 AS build
|
|
|
|
WORKDIR /go/src/fsd
|
|
COPY go.mod go.sum ./
|
|
|
|
# Cache module downloads
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
# Cache builds
|
|
ENV GOCACHE=/root/.cache/go-build
|
|
RUN --mount=type=cache,target="/root/.cache/go-build" CGO_ENABLED=0 go build -o /go/bin/fsd
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN addgroup -g 2001 nonroot && \
|
|
adduser -u 2001 -G nonroot -D nonroot && \
|
|
mkdir /db && chown -R nonroot:nonroot /db
|
|
|
|
COPY --from=build --chown=nonroot:nonroot /go/bin/fsd /
|
|
|
|
USER 2001:2001
|
|
|
|
CMD ["/fsd"]
|