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

Update non-root user in Dockerfile #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading