diff --git a/Dockerfile b/Dockerfile index 633fba1..28c164a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,14 +44,19 @@ RUN go mod download &&\ FROM ${PLATFORM}/alpine:3.15 -# tc - is needed for traffic control and shaping on the sidecar. it is part of the iproute2 +# Creating a non-root user +RUN adduser -D myuser +# tc - is needed for traffic control and shaping on the sidecar. it is part of the iproute2 +# Install necessary packages RUN apk add --no-cache ca-certificates \ iproute2 -# Copy our static executable. +# Switching to the non-root user +USER myuser -COPY --from=gobuilder bin/kubeslice-gw-sidecar . +# Copy our static executable. +COPY --from=gobuilder --chown=myuser:myuser bin/kubeslice-gw-sidecar . EXPOSE 5000