Skip to content

Commit a22e953

Browse files
chore(Dockerfile): bump alpine version and set uid for 'kafka-proxy' user
Signed-off-by: Sebastian Gaiser <[email protected]>
1 parent 44b9dcb commit a22e953

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 AS builder
1+
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.21 AS builder
22
RUN apk add alpine-sdk ca-certificates
33

44
ARG TARGETOS
@@ -21,7 +21,7 @@ RUN mkdir -p build && \
2121
go build -mod=vendor -o build/kafka-proxy \
2222
-ldflags "${LDFLAGS}" .
2323

24-
FROM --platform=$BUILDPLATFORM alpine:3.19
24+
FROM --platform=$BUILDPLATFORM alpine:3.21
2525
RUN apk add --no-cache ca-certificates libcap
2626
RUN adduser \
2727
--disabled-password \

Dockerfile.all

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 AS builder
1+
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.21 AS builder
22
RUN apk add alpine-sdk ca-certificates
33

44
ARG TARGETOS
@@ -27,7 +27,7 @@ RUN mkdir -p build && \
2727
go build -mod=vendor -o build/unsecured-jwt-provider -ldflags "${LDFLAGS}" cmd/plugin-unsecured-jwt-provider/main.go && \
2828
go build -mod=vendor -o build/oidc-provider -ldflags "${LDFLAGS}" cmd/plugin-oidc-provider/main.go
2929

30-
FROM --platform=$BUILDPLATFORM alpine:3.19
30+
FROM --platform=$BUILDPLATFORM alpine:3.21
3131
RUN apk add --no-cache ca-certificates libcap
3232
RUN adduser \
3333
--disabled-password \
@@ -50,4 +50,3 @@ RUN setcap 'cap_net_bind_service=+ep' /opt/kafka-proxy/bin/kafka-proxy && \
5050
USER kafka-proxy
5151
ENTRYPOINT ["/opt/kafka-proxy/bin/kafka-proxy"]
5252
CMD ["--help"]
53-

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,17 @@ spec:
496496
ports:
497497
- name: metrics
498498
containerPort: 9080
499+
securityContext:
500+
runAsNonRoot: true
501+
runAsUser: 65534
502+
allowPrivilegeEscalation: false
503+
capabilities:
504+
drop:
505+
- ALL
506+
add:
507+
- NET_BIND_SERVICE
508+
seccompProfile:
509+
type: RuntimeDefault
499510
livenessProbe:
500511
httpGet:
501512
path: /health
@@ -591,6 +602,17 @@ spec:
591602
mountPath: "/var/run/secret/kafka-client-certificate"
592603
- name: "tls-client-key-file"
593604
mountPath: "/var/run/secret/kafka-client-key"
605+
securityContext:
606+
runAsNonRoot: true
607+
runAsUser: 65534
608+
allowPrivilegeEscalation: false
609+
capabilities:
610+
drop:
611+
- ALL
612+
add:
613+
- NET_BIND_SERVICE
614+
seccompProfile:
615+
type: RuntimeDefault
594616
ports:
595617
- name: metrics
596618
containerPort: 9080

0 commit comments

Comments
 (0)