FROM registry.local/rgbarm64lib:latest as builder WORKDIR /usr/src/app/rgb COPY . . ENV GOPRIVATE=gitea.wagshome.duckdns.org ENV GONOSUMBDB=gitea.wagshome.duckdns.org RUN go mod tidy RUN CGO_ENABLED=1 go build --ldflags '-linkmode external -extldflags=-static' RUN mkdir -p /usr/src/app/work/ RUN cp /usr/src/app/rgb/rgb /usr/src/app/work/rgb FROM scratch COPY --from=builder /usr/src/app/rgb/rgb /usr/src/app/work/ COPY --from=builder /usr/src/app/rgb/mari* /usr/src/app/work/ WORKDIR /usr/src/app/work