mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-30 22:34:18 -05:00
docker: run imageproxy as non-privileged user
This commit is contained in:
parent
bfa1f74337
commit
be01bc1d27
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
FROM golang:1.9 as build
|
FROM golang:1.9 as build
|
||||||
MAINTAINER Will Norris <will@willnorris.com>
|
MAINTAINER Will Norris <will@willnorris.com>
|
||||||
|
|
||||||
|
RUN useradd -u 1001 go
|
||||||
|
|
||||||
WORKDIR /go/src/willnorris.com/go/imageproxy
|
WORKDIR /go/src/willnorris.com/go/imageproxy
|
||||||
ADD . .
|
ADD . .
|
||||||
|
|
||||||
|
@ -12,10 +14,13 @@ FROM scratch
|
||||||
|
|
||||||
WORKDIR /go/bin
|
WORKDIR /go/bin
|
||||||
|
|
||||||
|
COPY --from=build /etc/passwd /etc/passwd
|
||||||
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
||||||
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
COPY --from=build /etc/ssl/certs /etc/ssl/certs
|
||||||
COPY --from=build /go/bin/imageproxy .
|
COPY --from=build /go/bin/imageproxy .
|
||||||
|
|
||||||
|
USER go
|
||||||
|
|
||||||
CMD ["-addr", "0.0.0.0:8080"]
|
CMD ["-addr", "0.0.0.0:8080"]
|
||||||
ENTRYPOINT ["/go/bin/imageproxy"]
|
ENTRYPOINT ["/go/bin/imageproxy"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue