Skip to content

Commit

Permalink
docker: run imageproxy as non-privileged user
Browse files Browse the repository at this point in the history
  • Loading branch information
willnorris committed Mar 22, 2019
1 parent bfa1f74 commit be01bc1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM golang:1.9 as build
MAINTAINER Will Norris <will@willnorris.com>

RUN useradd -u 1001 go

WORKDIR /go/src/willnorris.com/go/imageproxy
ADD . .

Expand All @@ -12,10 +14,13 @@ FROM scratch

WORKDIR /go/bin

COPY --from=build /etc/passwd /etc/passwd
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=build /etc/ssl/certs /etc/ssl/certs
COPY --from=build /go/bin/imageproxy .

USER go

CMD ["-addr", "0.0.0.0:8080"]
ENTRYPOINT ["/go/bin/imageproxy"]

Expand Down

0 comments on commit be01bc1

Please sign in to comment.