forked from redpanda-data/kminion
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
35 lines (27 loc) · 863 Bytes
/
Dockerfile
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
29
30
31
32
33
34
35
############################################################
# Build image
############################################################
FROM golang:1.20-alpine as builder
ARG VERSION
ARG BUILT_AT
ARG COMMIT
RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build \
-ldflags="-w -s \
-X main.version=$VERSION \
-X main.commit=$COMMIT \
-X main.builtAt=$BUILT_AT" \
-o ./bin/kminion
############################################################
# Runtime Image
############################################################
FROM alpine:3
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /app/bin/kminion /app/kminion
RUN chmod -R +x /app/kminion
ENTRYPOINT ["/app/kminion"]