Skip to content

Commit 3121418

Browse files
author
Ronnie Beck
committed
- Adding experimental docker build container
1 parent 8e681eb commit 3121418

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM phusion/baseimage:master-amd64
2+
3+
LABEL maintainer="Georgios Sokianos <[email protected]>"
4+
5+
# Use baseimage-docker's init system.
6+
CMD ["/sbin/my_init"]
7+
8+
RUN dpkg --add-architecture i386; \
9+
apt-get update && apt-get -y install \
10+
autoconf ccache make mmake automake cmake \
11+
gcc \
12+
wget \
13+
lhasa \
14+
git subversion mercurial \
15+
gawk bison flex netpbm genisoimage sshpass \
16+
python-mako libswitch-perl gperf gcc-multilib g++ \
17+
patch bzip2 ca-certificates xz-utils \
18+
libpng-dev zlib1g-dev libxcursor-dev libgl1-mesa-dev libasound2-dev \
19+
libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libsdl1.2-dev byacc libxxf86vm1:i386; \
20+
ln -s /usr/bin/genisoimage /usr/bin/mkisofs; \
21+
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
22+
23+
# Add git branch name to bash prompt
24+
RUN sed -i '4c\'"\nparse_git_branch() {\n\
25+
git branch 2> /dev/null | sed -e \'/^[^*]/d\' -e \'s/* \\\(.*\\\)/ (\\\1)/\'\n\
26+
}\n" ~/.bashrc; \
27+
sed -i '43c\'"force_color_prompt=yes" ~/.bashrc; \
28+
sed -i '57c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\[\\\033[01;32m\\\]\\\u@\\\h\\\[\\\033[00m\\\]:\\\[\\\033[01;34m\\\]\\\w\\\[\\\033[01;31m\\\]\$(parse_git_branch)\\\[\\\033[00m\\\]\\\$ '" ~/.bashrc; \
29+
sed -i '59c\'" PS1=\'\${debian_chroot:+(\$debian_chroot)}\\\u@\\\h:\\\w \$(parse_git_branch)\$ \'" ~/.bashrc;
30+
# Clean up APT when done.
31+
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
32+
WORKDIR /usr/src

docker.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#sudo docker run -it --rm -v "$PWD":/git ubuntu "/bin/bash -c \"apt-get install git-core gcc g++ make cmake gawk bison flex bzip2 netpbm autoconf automake libx11-dev libxext-dev libc6-dev liblzo2-dev libxxf86vm-dev libpng-dev libsdl1.2-dev byacc python-mako libxcursor-dev gcc-multilib\"; /bin/bash"
3+
IMAGE_NAME=apolloos/builder
4+
5+
6+
#Do we have this image already?
7+
DOCKER_IMAGE_COUNT=$(docker image ls | awk -F\ '{ print $1 }' | grep "${IMAGE_NAME} | wc -l")
8+
echo ${DOCKER_IMAGE_COUNT}
9+
if [ "${DOCKER_IMAGE_COUNT}" == "" ]
10+
then
11+
docker build -t ${IMAGE_NAME} .
12+
fi
13+
14+
#Run the docker and start the build
15+
docker run -it --rm -v "$PWD":/usr/src ${IMAGE_NAME} /bin/bash -c "cd /usr/src; ./rebuild_all.sh"

0 commit comments

Comments
 (0)