mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
8d8c59a928
- build docker image with go1.14 - test with go1.14 and go1.13 - also run `go mod tidy` to pick up a missed go.sum record
28 lines
607 B
Docker
28 lines
607 B
Docker
FROM golang:1.14 as build
|
|
MAINTAINER Will Norris <will@willnorris.com>
|
|
|
|
RUN useradd -u 1001 go
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
COPY third_party/envy/go.mod ./third_party/envy/
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -v ./cmd/imageproxy
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /etc/passwd /etc/passwd
|
|
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
COPY --from=build /app/imageproxy /app/imageproxy
|
|
|
|
USER go
|
|
|
|
CMD ["-addr", "0.0.0.0:8080"]
|
|
ENTRYPOINT ["/app/imageproxy"]
|
|
|
|
EXPOSE 8080
|