# This Dockerfile expects "cloudprober" multi-platform binaries to exist in the # same directory. # # Docker image built using this can executed in the following manner: # docker run --net host -v $PWD/cloudprober.cfg:/etc/cloudprober.cfg \ # cloudprober/cloudprober FROM golang:latest as builder WORKDIR /go COPY . . RUN CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go build -ldflags "-linkmode external -extldflags -static" -o cloudprober ./cmd/cloudprober RUN go tool nm ./cloudprober | grep crypto/internal/boring/sig.BoringCrypto.abi0 > /dev/null FROM alpine:latest as certs RUN apk --update add ca-certificates FROM scratch COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=builder /go/cloudprober /cloudprober # Metadata params ARG BUILD_DATE ARG VERSION ARG VCS_REF # Metadata LABEL org.label-schema.build-date=$BUILD_DATE \ org.label-schema.name="Cloudprober" \ org.label-schema.vcs-url="https://github.com/cloudprober/cloudprober" \ org.label-schema.vcs-ref=$VCS_REF \ org.label-schema.version=$VERSION \ com.microscaling.license="Apache-2.0" ENTRYPOINT ["/cloudprober"]