diff --git a/Dockerfile b/Dockerfile index 5f38b95d198bb931e07e63985048067390456736..b9828c18e555384ac57e409e3d8aa073053f9592 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,18 @@ # syntax = docker/dockerfile:1.3 -FROM golang:1.18 +# Golang +FROM golang:1.19 as build WORKDIR /go/src/github.com/mccutchen/go-httpbin COPY . . + RUN --mount=type=cache,id=gobuild,target=/root/.cache/go-build \ make build buildtests +# distroless FROM gcr.io/distroless/base -COPY --from=0 /go/src/github.com/mccutchen/go-httpbin/dist/go-httpbin* /bin/ + +COPY --from=build /go/src/github.com/mccutchen/go-httpbin/dist/go-httpbin* /bin/ + EXPOSE 8080 -CMD ["/bin/go-httpbin"] +ENTRYPOINT ["/bin/go-httpbin"]