From a7d4bd895f76756c6667fdf93a1cbcd525b833c4 Mon Sep 17 00:00:00 2001 From: Stano Bocinec Date: Tue, 13 Jun 2023 13:20:37 +0200 Subject: [PATCH 1/2] build: use the same alpine OS version in Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5679e49..f45da6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ############################################################ # Build image ############################################################ -FROM golang:1.20-alpine as builder +FROM golang:1.20-alpine3.18 as builder ARG VERSION ARG BUILT_AT @@ -27,7 +27,7 @@ RUN CGO_ENABLED=0 go build \ ############################################################ # Runtime Image ############################################################ -FROM alpine:3.17 +FROM alpine:3.18 COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /app/bin/kminion /app/kminion RUN addgroup -S redpanda \ From 3391840172a9db688f1d524156eafed9e9c076c0 Mon Sep 17 00:00:00 2001 From: Stano Bocinec Date: Tue, 13 Jun 2023 13:21:42 +0200 Subject: [PATCH 2/2] build: run OS pkg update on image build --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f45da6e..7d17489 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,8 @@ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /app/bin/kminion /app/kminion RUN addgroup -S redpanda \ && adduser -S redpanda -G redpanda \ - && chmod o+rx /app/kminion + && chmod o+rx /app/kminion \ + && apk upgrade --no-cache USER redpanda ENTRYPOINT ["/app/kminion"]