diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3553b03 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ + +# +# 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 + +# 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 c1dfeff..6d70056 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,18 @@ 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 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). 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]