mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-08 21:14:56 +09:00
24 lines
571 B
Docker
24 lines
571 B
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
ARG TARGETOS
|
|
ARG TARGETARCH
|
|
|
|
WORKDIR /workspace
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go mod download
|
|
|
|
COPY api api/
|
|
COPY pkg pkg/
|
|
COPY cmd cmd/
|
|
COPY internal internal/
|
|
|
|
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -o /backup-controller cmd/backup-controller/main.go
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /backup-controller /backup-controller
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
ENTRYPOINT ["/backup-controller"]
|