2014-04-11 11:01:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
cd `dirname -- $0`
|
|
|
|
DIR=`pwd`
|
|
|
|
|
|
|
|
cd docker
|
2014-04-11 12:17:04 +02:00
|
|
|
|
|
|
|
cat > Dockerfile <<DOCKER
|
|
|
|
FROM debian:jessie
|
|
|
|
RUN apt-get update
|
|
|
|
RUN apt-get install -y clang cmake make ccache flex bison libboost-all-dev libssl-dev git-core cgdb subversion
|
|
|
|
RUN groupadd -g `id -g` icinga
|
|
|
|
RUN useradd -m -u `id -u` -g icinga icinga
|
|
|
|
WORKDIR /home/icinga
|
|
|
|
USER icinga
|
|
|
|
RUN mkdir gdb_printers && cd gdb_printers && svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
|
|
|
|
RUN git clone https://github.com/ruediger/Boost-Pretty-Printer
|
|
|
|
RUN mkdir build
|
|
|
|
ENV HOME /home/icinga
|
|
|
|
DOCKER
|
|
|
|
|
2014-04-11 11:01:38 +02:00
|
|
|
docker.io build -t icinga2 --rm .
|
2014-04-11 11:42:37 +02:00
|
|
|
|
|
|
|
if [ "$1" != "-i" ]; then
|
2014-04-11 12:17:04 +02:00
|
|
|
command="/home/icinga/icinga2/dev/docker/build"
|
2014-04-11 11:42:37 +02:00
|
|
|
else
|
|
|
|
command="/bin/bash"
|
|
|
|
fi
|
|
|
|
|
2014-04-11 12:17:04 +02:00
|
|
|
mkdir -p ~/.ccache
|
|
|
|
mkdir -p $DIR/.build
|
|
|
|
mkdir -p $DIR/config
|
|
|
|
|
|
|
|
docker.io run -u `id -u` -v $DIR/..:/home/icinga/icinga2 -v $DIR/.build:/home/icinga/icinga2-build -v ~/.ccache:/home/icinga/.ccache -v $DIR/config:/home/icinga/icinga2-config -t -i --rm icinga2 $command
|