2020-04-04 01:21:35 -05:00
|
|
|
FROM golang:1.14 as build
|
2017-10-06 22:07:07 -05:00
|
|
|
MAINTAINER Will Norris <will@willnorris.com>
|
2015-05-21 15:53:41 -05:00
|
|
|
|
2019-03-22 02:07:32 -05:00
|
|
|
RUN useradd -u 1001 go
|
|
|
|
|
2019-03-22 02:31:42 -05:00
|
|
|
WORKDIR /app
|
2015-05-21 15:53:41 -05:00
|
|
|
|
2019-03-22 02:31:42 -05:00
|
|
|
COPY go.mod go.sum ./
|
2019-06-09 16:55:19 -05:00
|
|
|
COPY third_party/envy/go.mod ./third_party/envy/
|
2019-03-22 02:31:42 -05:00
|
|
|
RUN go mod download
|
2017-09-10 12:00:23 -05:00
|
|
|
|
2019-03-22 02:31:42 -05:00
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -v ./cmd/imageproxy
|
2017-09-10 12:00:23 -05:00
|
|
|
|
2019-03-22 02:31:42 -05:00
|
|
|
FROM scratch
|
2017-09-10 12:00:23 -05:00
|
|
|
|
2019-03-22 02:07:32 -05:00
|
|
|
COPY --from=build /etc/passwd /etc/passwd
|
2017-10-06 22:07:07 -05:00
|
|
|
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
2019-03-22 02:13:00 -05:00
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
2019-03-22 02:31:42 -05:00
|
|
|
COPY --from=build /app/imageproxy /app/imageproxy
|
2017-09-10 12:00:23 -05:00
|
|
|
|
2019-03-22 02:07:32 -05:00
|
|
|
USER go
|
|
|
|
|
2017-09-10 12:00:23 -05:00
|
|
|
CMD ["-addr", "0.0.0.0:8080"]
|
2019-03-22 02:31:42 -05:00
|
|
|
ENTRYPOINT ["/app/imageproxy"]
|
2015-05-21 15:53:41 -05:00
|
|
|
|
|
|
|
EXPOSE 8080
|