2022-11-14 11:18:09 -08:00
|
|
|
# syntax=docker/dockerfile:1.4
|
|
|
|
FROM --platform=$BUILDPLATFORM cgr.dev/chainguard/go:latest as build
|
2020-09-09 15:41:34 -07:00
|
|
|
LABEL maintainer="Will Norris <will@willnorris.com>"
|
2015-05-21 23:53:41 +03:00
|
|
|
|
2019-03-22 07:31:42 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
2017-09-10 19:00:23 +02:00
|
|
|
|
2019-03-22 07:31:42 +00:00
|
|
|
COPY . .
|
|
|
|
|
2022-11-14 11:18:09 -08:00
|
|
|
ARG TARGETOS
|
|
|
|
ARG TARGETARCH
|
|
|
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -v ./cmd/imageproxy
|
2017-09-10 19:00:23 +02:00
|
|
|
|
2022-11-14 11:18:09 -08:00
|
|
|
FROM cgr.dev/chainguard/static:latest
|
2017-09-10 19:00:23 +02:00
|
|
|
|
2019-03-22 07:31:42 +00:00
|
|
|
COPY --from=build /app/imageproxy /app/imageproxy
|
2017-09-10 19:00:23 +02:00
|
|
|
|
|
|
|
CMD ["-addr", "0.0.0.0:8080"]
|
2019-03-22 07:31:42 +00:00
|
|
|
ENTRYPOINT ["/app/imageproxy"]
|
2015-05-21 23:53:41 +03:00
|
|
|
|
|
|
|
EXPOSE 8080
|