-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build iprange and netdata statically on x86_64
Uses an alpine linux docker image with musl + gcc to do the build. No attempt is made to package/release the contents yet.
- Loading branch information
1 parent
acacd9a
commit 05f7bcb
Showing
7 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/sh | ||
|
||
# https://twindb.com/building-rpm-on-travis-ci-in-docker-containers/ | ||
# https://lebkowski.name/docker-volumes/ | ||
# | ||
# Clean up all existed images: | ||
# sudo docker rm -v $(sudo docker ps -a -q -f status=exited) | ||
|
||
set -e | ||
|
||
. ./package.conf | ||
|
||
IPRANGE_MD5=`cut -f1 -d' ' < build/iprange.md5` | ||
|
||
mkdir -p build/x86_64-static | ||
cd build/x86_64-static | ||
|
||
cp -rp ../../x86_64-static/*.sh . | ||
|
||
sudo rm -rf iprange netdata | ||
|
||
tar xfj ../iprange-$IPRANGE_VERSION.tar.bz2 | ||
mv iprange-$IPRANGE_VERSION iprange | ||
cp -rp ../../x86_64-static/iprange/*.sh iprange | ||
|
||
tar xfj ../netdata-$NETDATA_VERSION.tar.bz2 | ||
mv netdata-$NETDATA_VERSION netdata | ||
cp -rp ../../x86_64-static/netdata/*.sh netdata | ||
|
||
if ! sudo docker inspect firehol-package-x86_64-static > /dev/null 2>&1 | ||
then | ||
# To run interactively: | ||
# sudo docker run -it firehol-package-x86_64-static /bin/sh | ||
# (add -v host-dir:guest-dir:rw arguments to mount volumes) | ||
# To remove images in order to re-create: | ||
# sudo docker rm -v $(sudo docker ps -a -q -f status=exited) | ||
# sudo docker rmi firehol-package-x86_64-static | ||
sudo docker run -v `pwd`:/fh-build/x86_64-static:rw alpine:3.5 \ | ||
/bin/sh /fh-build/x86_64-static/docker-setup.sh | ||
id=`sudo docker ps -l -q` | ||
sudo docker commit $id firehol-package-x86_64-static | ||
fi | ||
sudo docker run -v `pwd`:/fh-build/x86_64-static:rw firehol-package-x86_64-static \ | ||
/bin/sh /fh-build/x86_64-static/iprange/docker-build.sh | ||
sudo docker run -v `pwd`:/fh-build/x86_64-static:rw firehol-package-x86_64-static \ | ||
/bin/sh /fh-build/x86_64-static/netdata/docker-build.sh | ||
cd ../.. | ||
|
||
if [ "$USER" ] | ||
then | ||
sudo chown -R "$USER" . | ||
fi | ||
|
||
# TODO: cp -p ??? output/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/bin/sh | ||
|
||
rm -rf build | ||
rm -rf output | ||
sudo rm -rf build output | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Set up an alpine linux docker image so we can perform static builds in it | ||
apk update | ||
apk add --no-cache binutils make libgcc musl-dev gcc g++ | ||
|
||
# FireHOL/Netdata dependencies | ||
apk add --no-cache ipset iptables tcpdump libuuid e2fsprogs-dev zlib-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
base=`dirname $0` | ||
cd "$base" | ||
echo "Running `basename $0` in $0" | ||
|
||
LDFLAGS=-static export LDFLAGS | ||
./configure | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
base=`dirname $0` | ||
cd "$base" | ||
echo "Running `basename $0` in $0" | ||
|
||
LDFLAGS=-static export LDFLAGS | ||
./configure --prefix=/opt | ||
make | ||
make install DESTDIR=`pwd` |