2021-01-05 20:47:41 +11:00
|
|
|
FROM golang:latest as builder
|
2021-01-01 21:18:17 +11:00
|
|
|
WORKDIR /go/src/sungrow
|
|
|
|
COPY . .
|
|
|
|
|
2024-03-22 21:14:02 +11:00
|
|
|
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 .
|
2021-01-05 20:47:41 +11:00
|
|
|
|
|
|
|
FROM gcr.io/distroless/static:latest
|
|
|
|
COPY --from=builder /go/src/sungrow/sungrow /usr/bin/
|
2021-01-01 21:18:17 +11:00
|
|
|
|
2021-01-05 20:47:41 +11:00
|
|
|
CMD ["/usr/bin/sungrow"]
|