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
25
25
FROM alpine:3
26
26
RUN apk add --no-cache \
27
27
ca-certificates \
28
- fuse \
29
28
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
30
31
# Add a non-root user matching the nonroot user from the main container
31
32
RUN 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
33
34
USER 65532
34
35
35
36
COPY --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
23
23
24
24
# Final stage
25
25
FROM 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
29
29
# Add a non-root user matching the nonroot user from the main container
30
30
RUN 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
32
32
USER 65532
33
33
34
34
COPY --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