File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,12 @@ RUN go build -ldflags "-X main.metadataString=container.alpine" -o cloud_sql_pro
2525FROM alpine:3
2626RUN apk add --no-cache \
2727 ca-certificates \
28- fuse \
2928 libc6-compat
29+ # Install fuse and allow enable non-root users to mount
30+ RUN apk add --no-cache fuse && sed -i 's/^#user_allow_other$/user_allow_other/g' /etc/fuse.conf
3031# Add a non-root user matching the nonroot user from the main container
3132RUN addgroup -g 65532 -S nonroot && adduser -u 65532 -S nonroot -G nonroot
32- # set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
33+ # Set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
3334USER 65532
3435
3536COPY --from=build --chown=nonroot /go/src/cloudsql-proxy/cloud_sql_proxy /cloud_sql_proxy
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ RUN go build -ldflags "-X main.metadataString=container.buster" -o cloud_sql_pro
2323
2424# Final stage
2525FROM debian:buster
26- RUN apt-get update && apt-get install -y \
27- ca-certificates \
28- fuse
26+ RUN apt-get update && apt-get install -y ca-certificates
27+ # Install fuse and allow enable non-root users to mount
28+ RUN apt-get update && apt-get install -y fuse && sed -i 's/^#user_allow_other$/user_allow_other/g' /etc/fuse.conf
2929# Add a non-root user matching the nonroot user from the main container
3030RUN groupadd -g 65532 -r nonroot && useradd -u 65532 -g 65532 -r nonroot
31- # set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
31+ # Set the uid as an integer for compatibility with runAsNonRoot in Kubernetes
3232USER 65532
3333
3434COPY --from=build --chown=nonroot /go/src/cloudsql-proxy/cloud_sql_proxy /cloud_sql_proxy
You can’t perform that action at this time.
0 commit comments