-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.helm
More file actions
23 lines (21 loc) · 863 Bytes
/
Dockerfile.helm
File metadata and controls
23 lines (21 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Builder stage
FROM docker.io/library/golang:1.26.1 AS builder
WORKDIR /build
# Copy go mod files and download dependencies
COPY ./src/go.mod ./src/go.sum ./
RUN go mod download
# Copy the rest of the source code
COPY ./src/ ./
# Build the helmizer binary with CGO disabled for a fully static binary
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o helmizer .
# Helm stage
FROM docker.io/alpine/helm:4.1.0 AS helm
# Final stage
FROM scratch AS final
# Copy the helm binary and helmizer binary to a known location
COPY --from=helm /usr/bin/helm /usr/local/bin/helm
COPY --from=builder /build/helmizer /usr/local/bin/helmizer
# Provide CA certificates for TLS
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# By default, set the binary as the entry point in case you want to run it
ENTRYPOINT ["/usr/local/bin/helmizer"]