-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (23 loc) · 864 Bytes
/
Dockerfile
File metadata and controls
28 lines (23 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build
ARG TARGETOS
ARG TARGETARCH
ARG VERSION=dev
ARG REVISION=unknown
ARG BUILTAT=unknown
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
go build -trimpath \
-ldflags="-s -w \
-X github.com/cocoonstack/cocoon-operator/version.VERSION=${VERSION} \
-X github.com/cocoonstack/cocoon-operator/version.REVISION=${REVISION} \
-X github.com/cocoonstack/cocoon-operator/version.BUILTAT=${BUILTAT}" \
-o /out/cocoon-operator .
FROM alpine:3.21 AS runtime-deps
RUN apk add --no-cache ca-certificates
FROM busybox:stable-musl
COPY --from=runtime-deps /etc/ssl/certs/ /etc/ssl/certs/
COPY --from=build /out/cocoon-operator /usr/bin/cocoon-operator
ENTRYPOINT ["/usr/bin/cocoon-operator"]