Skip to content
Snippets Groups Projects
Commit d3cb577d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'docker-build-script' into 'master'

docker build script

See merge request piotr.gawron/minerva!226
parents 85583ec9 12b274fd
No related branches found
No related tags found
1 merge request!226docker build script
Pipeline #
alias l='ls -al --color'
if test -z "$DISPLAY" -a "$TERM" = "xterm" -a -x /usr/bin/who ; then
WHOAMI="`/usr/bin/who am i`"
_DISPLAY="`expr "$WHOAMI" : '.*(\([^\.][^\.]*\).*)'`:0.0"
if [ "${_DISPLAY}" != ":0:0.0" -a "${_DISPLAY}" != " :0.0" \
-a "${_DISPLAY}" != ":0.0" ]; then
export DISPLAY="${_DISPLAY}";
fi
unset WHOAMI _DISPLAY
fi
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] "
cd ~
supervisord -c /etc/supervisor/conf.d/supervisord.conf
#Docker description file for minerva framework.
FROM debian:jessie
MAINTAINER Piotr Gawron <piotr.gawron@uni.lu>
#setup non interactive install in apt-get
ENV DEBIAN_FRONTEND noninteractive
#installation of needed packages
#Some basic tools (optionally)
RUN apt-get update
RUN apt-get install -y apt-utils w3m
RUN apt-get install -y telnet
RUN apt-get install -y vim
RUN apt-get install -y procps
RUN apt-get install -y wget
#Minerva repo is via ssl
RUN apt-get install -y apt-transport-https
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
#Java 8 repository
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list
RUN echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN apt-get update
#Make sure that installer won't ask for accepting license
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
#Minerva uni.lu repository
RUN echo "deb http://repo-r3lab.uni.lu/debian/ stable main" | tee /etc/apt/sources.list.d/r3lab-uni.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xcb185f4e31872412
RUN apt-get update
#install dependencies separatelly (usefull when we change something - then we don't have to do everything from scratch)
RUN apt-get install -y tomcat7 && /etc/init.d/tomcat7 stop
RUN apt-get install -y postgresql
RUN apt-get install -y oracle-java8-set-default
ADD policy-rc.d /tmp/policy-rc.d
RUN apt-get update
#when we install minerva allow to start services, so everything can be installed properly
#but we need to disable tomcat7 because tomcat7 requires SYS_PTRACE and we cannot start it:
#take a look here:
#http://stackoverflow.com/questions/29683231/tomcat7-fail-to-start-inside-ubuntu-docker-container
RUN mv /usr/sbin/policy-rc.d /usr/sbin/policy-rc.d.backup && \
mv /tmp/policy-rc.d /usr/sbin/policy-rc.d && \
apt-get install -y minerva && \
mv /usr/sbin/policy-rc.d.backup /usr/sbin/policy-rc.d
EXPOSE 8080
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD .bashrc /root/
#!/bin/bash
#docker build --no-cache -t minerva .
docker build -t minerva .
docker run -p 8080:8080 -t -i minerva bash
#!/bin/sh
# For most Docker users, "apt-get install" only happens during "docker build",
# where starting services doesn't work and often fails in humorous ways. This
# prevents those failures by stopping the services from attempting to start.
echo "policy-rc.d for " $1
if [ "$1" = "tomcat7" ] || [ "$1" = "tomcat8" ];
then
exit 101
fi
exit 0;
[supervisord]
nodaemon=false
logfile=/var/log/supervisor/supervisor.log
[program:postgresql]
command=/etc/init.d/postgresql start
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
[program:tomcat]
command=/etc/init.d/tomcat7 start
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
startretries=0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment