From 99e0c703c752efa9f73c709308d11b3540b6135a Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Mon, 23 Dec 2019 16:48:43 +0100 Subject: [PATCH 1/3] added instructions for running --- Dockerfile | 26 ++++++++++++++++++++++++++ README.md | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6c5cb00 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ + +# +# Birdwatcher - Your friendly alice looking glass data source +# + +FROM golang:1.13 AS app + +WORKDIR /src/birdwatcher +ADD vendor . +ADD go.mod . +ADD go.sum . +RUN go mod download + +# Add sourcecode +ADD . . + +# Build birdwatcher +RUN make + +FROM ehlers/bird2 + +COPY --from=app /src/birdwatcher/birdwatcher-linux-amd64 /usr/bin/birdwatcher +ADD etc/birdwatcher/birdwatcher.conf /etc/birdwatcher/birdwatcher.conf + +ENTRYPOINT ["/usr/bin/birdwatcher", "-config", "/etc/birdwatcher/birdwatcher.conf"] + diff --git a/README.md b/README.md index c1dfeff..29e0dad 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,12 @@ You need to add a Large BGP Community just before you filter a route, for exampl accept; } +### Using Docker + +You can run the birdwatcher for bird2 with docker: + + docker run -v /var/run/bird.ctl:/usr/local/var/run/bird.ctl -it --rm birdwatcher:latest + ### Building an RPM Building RPMs is supported through [fpm](https://github.com/jordansissel/fpm). From 4f4a4f77cfa937da71f483caedc739a511869fc9 Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Mon, 23 Dec 2019 17:16:39 +0100 Subject: [PATCH 2/3] removed paths --- etc/birdwatcher/birdwatcher.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/birdwatcher/birdwatcher.conf b/etc/birdwatcher/birdwatcher.conf index b15f4dd..d398731 100755 --- a/etc/birdwatcher/birdwatcher.conf +++ b/etc/birdwatcher/birdwatcher.conf @@ -69,13 +69,13 @@ requests_per_minute = 10 [bird] listen = "0.0.0.0:29184" config = "/etc/bird.conf" -birdc = "/sbin/birdc" +birdc = "birdc" ttl = 5 # time to live (in minutes) for caching of cli output [bird6] listen = "0.0.0.0:29186" config = "/etc/bird6.conf" -birdc = "/sbin/birdc6" +birdc = "birdc6" ttl = 5 # time to live (in minutes) for caching of cli output [parser] From 242c585119819808b8323085dc1b98b89613d3bd Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Mon, 23 Dec 2019 17:17:43 +0100 Subject: [PATCH 3/3] updated running instructions --- Dockerfile | 4 ++++ README.md | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6c5cb00..3553b03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,10 +17,14 @@ ADD . . # Build birdwatcher RUN make +# Add birdwatcher to bird FROM ehlers/bird2 COPY --from=app /src/birdwatcher/birdwatcher-linux-amd64 /usr/bin/birdwatcher ADD etc/birdwatcher/birdwatcher.conf /etc/birdwatcher/birdwatcher.conf +EXPOSE 29184/tcp +EXPOSE 29186/tcp + ENTRYPOINT ["/usr/bin/birdwatcher", "-config", "/etc/birdwatcher/birdwatcher.conf"] diff --git a/README.md b/README.md index 29e0dad..6d70056 100644 --- a/README.md +++ b/README.md @@ -128,8 +128,14 @@ You need to add a Large BGP Community just before you filter a route, for exampl You can run the birdwatcher for bird2 with docker: - docker run -v /var/run/bird.ctl:/usr/local/var/run/bird.ctl -it --rm birdwatcher:latest + docker pull alicelg/birdwatcher:latest + docker run -p 29184:29184 -v /var/run/bird.ctl:/usr/local/var/run/bird.ctl -it --rm birdwatcher:latest + + +Or build your own image: + + docker build . -t alicelg/birdwatcher:latest ### Building an RPM Building RPMs is supported through [fpm](https://github.com/jordansissel/fpm).