Skip to content

Commit

Permalink
Add non root user
Browse files Browse the repository at this point in the history
For running on secured clusters
  • Loading branch information
rchojn authored and houqp committed Aug 27, 2020
1 parent de35288 commit 05684bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM golang:1.13.1 as build
RUN groupadd -g 1000 1000 && \
useradd -r -u 1000 -g 1000 1000
ADD . /app
RUN chown 1000 app
WORKDIR /app

RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static"'

FROM alpine:3.10.1

COPY --from=build /app/objinsync /bin/objinsync
USER 1000

0 comments on commit 05684bb

Please sign in to comment.