Use the right UID and GID for build files.

Refs #5996
This commit is contained in:
Gunnar Beutner 2014-04-11 12:17:04 +02:00
parent 492ec9dba8
commit a601911059
3 changed files with 32 additions and 16 deletions

View File

@ -1,8 +0,0 @@
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 cd /root && mkdir gdb_printers && cd gdb_printers && svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python
RUN cd /root && git clone https://github.com/ruediger/Boost-Pretty-Printer
RUN mkdir /root/build
ADD build /root/build
ENV HOME /root

View File

@ -1,16 +1,21 @@
#!/bin/sh #!/bin/sh
cd $(dirname -- $0) || exit 1 if [ ! -e /.dockerenv ]; then
echo "This script should only be run in the Docker VM environment."
exit 1
fi
cp icinga2/tools/debug/gdb/gdbinit /root/.gdbinit cd
sed -i 's/home\/gbeutner/root/' /root/.gdbinit
cp icinga2/tools/debug/gdb/gdbinit ~/.gdbinit
sed -i 's/home\/gbeutner/home\/icinga/' ~/.gdbinit
cd icinga2-build || exit 1 cd icinga2-build || exit 1
CCACHE_SLOPPINESS="include_file_mtime" CCACHE_SLOPPINESS="include_file_mtime"
export CCACHE_SLOPPINESS export CCACHE_SLOPPINESS
if [ ! -e CMakeCache.txt ]; then if [ ! -e Makefile ]; then
CC="ccache clang" CXX="ccache clang++" cmake ../icinga2 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/icinga2 -DCMAKE_INSTALL_SYSCONFDIR=/root/icinga2-config CC="ccache clang" CXX="ccache clang++" cmake ../icinga2 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=~/icinga2-install -DCMAKE_INSTALL_SYSCONFDIR=~/icinga2-config
fi fi
make -j 4 && make install && cgdb -ex set scheduler-locking step -ex r --args /opt/icinga2/sbin/icinga2 -c /root/icinga2-config/icinga2/icinga2.conf -DUseVfork=0 make -j 4 && make install && cgdb -ex set scheduler-locking step -ex r --args ~/icinga2-install/sbin/icinga2 -c ~/icinga2-config/icinga2/icinga2.conf -DUseVfork=0

23
dev/run
View File

@ -3,12 +3,31 @@ cd `dirname -- $0`
DIR=`pwd` DIR=`pwd`
cd docker cd docker
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
docker.io build -t icinga2 --rm . docker.io build -t icinga2 --rm .
if [ "$1" != "-i" ]; then if [ "$1" != "-i" ]; then
command="/root/build" command="/home/icinga/icinga2/dev/docker/build"
else else
command="/bin/bash" command="/bin/bash"
fi fi
docker.io run -v $DIR/..:/root/icinga2 -v $DIR/.build:/root/icinga2-build -v $HOME/.ccache:/root/.ccache -v $DIR/config:/root/icinga2-config -t -i --rm icinga2 $command 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