FROM golang:latest AS builder WORKDIR /go/src/sungrow COPY . . RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/go/pkg/mod \ CGO_ENABLED=0 go build -v -o sungrow . FROM gcr.io/distroless/static:latest COPY --from=builder /go/src/sungrow/sungrow /usr/bin/ CMD ["/usr/bin/sungrow"]