Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Dockerfile): bump alpine version and set uid for 'kafka-proxy' … #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.21 AS builder
RUN apk add alpine-sdk ca-certificates

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

FROM --platform=$BUILDPLATFORM alpine:3.19
FROM --platform=$BUILDPLATFORM alpine:3.21
RUN apk add --no-cache ca-certificates libcap
RUN adduser \
--disabled-password \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.all
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.19 AS builder
FROM --platform=$BUILDPLATFORM golang:1.22-alpine3.21 AS builder
RUN apk add alpine-sdk ca-certificates

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

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

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,17 @@ spec:
ports:
- name: metrics
containerPort: 9080
securityContext:
runAsNonRoot: true
runAsUser: 65534
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
seccompProfile:
type: RuntimeDefault
livenessProbe:
httpGet:
path: /health
Expand Down Expand Up @@ -591,6 +602,17 @@ spec:
mountPath: "/var/run/secret/kafka-client-certificate"
- name: "tls-client-key-file"
mountPath: "/var/run/secret/kafka-client-key"
securityContext:
runAsNonRoot: true
runAsUser: 65534
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
seccompProfile:
type: RuntimeDefault
ports:
- name: metrics
containerPort: 9080
Expand Down