mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-03-20 11:41:06 +00:00
24 lines
586 B
Docker
24 lines
586 B
Docker
FROM golang:1.24-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 /cozystack-controller cmd/cozystack-controller/main.go
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=builder /cozystack-controller /cozystack-controller
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
ENTRYPOINT ["/cozystack-controller"]
|