From e728d35ce003ce711989a737eb0b9911a4c6ad9b Mon Sep 17 00:00:00 2001 From: Kevin Klopfenstein Date: Tue, 10 Aug 2021 23:59:48 +0200 Subject: [PATCH] #7 adding binaries to dockerfile (#12) --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index ce78e7e..30b2878 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,17 @@ FROM golang AS gobgp RUN go get github.com/osrg/gobgp/cmd/gobgp +FROM golang AS gobgp-exporter +RUN cd $GOPATH/src \ + && mkdir -p github.com/greenpau \ + && cd github.com/greenpau \ + && git clone https://github.com/greenpau/gobgp_exporter.git \ + && cd gobgp_exporter \ + && CGO_ENABLED=0 make + FROM gcr.io/distroless/base COPY goblackhole /usr/bin/goblackhole COPY ./config.yaml /etc/goblackhole/config.yaml +COPY --from=gobgp-exporter /go/src/github.com/greenpau/gobgp_exporter/bin/gobgp-exporter /usr/bin/gobgp-exporter COPY --from=gobgp /go/bin/gobgp /usr/bin/gobgp CMD ["/usr/bin/goblackhole"]