Skip to content

Commit

Permalink
Merge pull request projectcalico#10 from projectcalico/build_more_files
Browse files Browse the repository at this point in the history
Build both IPv4 and IPv6 versions of Bird
  • Loading branch information
tomdee committed Aug 18, 2015
2 parents 6a79023 + b40ccb7 commit 331ee19
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
FROM alpine:latest

RUN apk update
RUN apk add alpine-sdk linux-headers ncurses-dev readline-dev autoconf flex bison
RUN apk add alpine-sdk linux-headers autoconf flex bison ncurses-dev readline-dev

#COPY . /code
WORKDIR /code
#RUN autoconf
#RUN ./configure --with-protocols="bgp pipe static" --enable-ipv6 --enable-pthreads
#RUN make
#RUN rm bird bird6 birdc birdcl
#RUN make CC="gcc - static"

11 changes: 2 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
docker build -t birdbuild .
docker run --rm -v `pwd`:/code birdbuild sh -c '\
autoconf && \
./configure --with-protocols="bgp pipe static" --enable-ipv6=yes --enable-client=no --enable-pthreads=yes && \
make && \
rm bird && \
make CC="gcc -static"
'
mkdir -p dist
cp bird dist

docker run --name bird-build -v `pwd`:/code birdbuild ./create_binaries.sh
docker rm -f bird-build || true
20 changes: 20 additions & 0 deletions create_binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
autoconf
# Configure just the protocols we need, and enable the client and IPv6
./configure --with-protocols="bgp pipe static" --enable-ipv6=yes --enable-client=yes --enable-pthreads=yes
make

# Remove the dynmaic binaries and rerun make to create static binaries and store off the results
rm bird birdcl
make CC="gcc -static"
cp bird dist/bird6
cp birdcl dist

# Rerun the build but without IPv6 (or the client) and store off the result.
make clean
./configure --with-protocols="bgp pipe static" --enable-client=no --enable-pthreads=yes
make
rm bird
make CC="gcc -static"
cp bird dist/bird

0 comments on commit 331ee19

Please sign in to comment.