-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
56 lines (46 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
# Birdwatcher - Your friendly alice looking glass data source
#
# Build birdwatcher
FROM golang:1.13 AS birdwatcher
WORKDIR /src/birdwatcher
ADD . .
RUN go mod download
RUN make linux_static
# Build bird
FROM alpine:latest AS bird
WORKDIR /src
RUN apk add --no-cache \
gcc \
make \
musl-dev \
autoconf \
automake \
flex \
bison \
git \
coreutils \
linux-headers \
ncurses-static \
readline-dev \
readline-static
# Clone the latest version 2 tag of the bird repository
RUN git clone \
--branch $(git ls-remote --tags https://gitlab.nic.cz/labs/bird | awk -F'/' '{print $3}' | grep '^v2\.' | grep -v '{}' | sort -V | tail -n 1) \
https://gitlab.nic.cz/labs/bird.git
WORKDIR /src/bird
RUN autoreconf && \
LDFLAGS="-static -static-libgcc" \
./configure \
--prefix=/ \
--exec-prefix=/usr \
--runstatedir=/run/bird && \
make -j
# Final stage
FROM scratch
COPY --from=bird /src/bird/birdcl /usr/bin/birdc
COPY --from=birdwatcher /src/birdwatcher/birdwatcher-linux-amd64 /usr/bin/birdwatcher
COPY --from=birdwatcher /src/birdwatcher/etc/birdwatcher/birdwatcher.conf /etc/birdwatcher/birdwatcher.conf
EXPOSE 29184/tcp
EXPOSE 29186/tcp
CMD ["/usr/bin/birdwatcher", "-config", "/etc/birdwatcher/birdwatcher.conf"]