mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
20 lines
373 B
Plaintext
20 lines
373 B
Plaintext
FROM --platform=$BUILDPLATFORM golang:alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Download Go modules
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY *.go ./
|
|
|
|
# Build
|
|
ARG TARGETOS TARGETARCH
|
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /agent .
|
|
|
|
# ? -------------------------
|
|
FROM scratch
|
|
|
|
COPY --from=builder /agent /agent
|
|
|
|
ENTRYPOINT ["/agent"] |