2022-04-12 16:06:10 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM golang:1.18-alpine AS builder
|
2019-12-27 17:23:08 +00:00
|
|
|
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
|
|
|
|
WORKDIR /go/src
|
|
|
|
ADD . .
|
|
|
|
|
|
|
|
RUN GOOS=$(echo $TARGETPLATFORM | cut -f1 -d/) && \
|
|
|
|
GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d/) && \
|
|
|
|
GOARM=$(echo $TARGETPLATFORM | cut -f3 -d/ | sed "s/v//" ) && \
|
2021-09-11 19:29:35 +00:00
|
|
|
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -tags netgo,no_d2xx ./cmd/rc-pca9685/
|
2019-12-27 17:23:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM gcr.io/distroless/static
|
|
|
|
|
|
|
|
USER 1234
|
|
|
|
COPY --from=builder /go/src/rc-pca9685 /go/bin/rc-pca9685
|
|
|
|
ENTRYPOINT ["/go/bin/rc-pca9685"]]
|