forked from Reading-eScience-Centre/ncwms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·55 lines (48 loc) · 2.33 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM unidata/tomcat-docker:8
MAINTAINER Kyle Wilcox <[email protected]>
RUN \
apt-get update && \
apt-get install -y \
git \
maven \
unzip \
&& \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Fix for java8 in jessie
# https://serverfault.com/questions/830636/cannot-install-openjdk-8-jre-headless-on-debian-jessie/830637#830637
# https://askubuntu.com/questions/190582/installing-java-automatically-with-silent-option
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main\ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" > /etc/apt/sources.list.d/webupd8team-java.list && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
apt-get update && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
apt-get install -y oracle-java8-installer && \
update-java-alternatives -s java-8-oracle && \
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
# Compile edal to use required features in develop branch
ENV EDAL_VERSION edal-1.2.12
RUN mkdir /edal && \
cd /edal && \
git clone https://github.com/Reading-eScience-Centre/edal-java.git && \
cd edal-java && \
git checkout ${EDAL_VERSION} && \
JAVA_HOME=/usr/lib/jvm/java-8-oracle mvn clean install
# Compile and install ncWMS
COPY . /ncWMS
RUN cd /ncWMS && \
JAVA_HOME=/usr/lib/jvm/java-8-oracle mvn clean install && \
unzip target/ncWMS2.war -d $CATALINA_HOME/webapps/ncWMS/ && \
rm -rf /edal && \
rm -rf /ncWMS/target
# Set login-config to BASIC since it is handled through Tomcat
RUN sed -i -e 's/DIGEST/BASIC/' $CATALINA_HOME/webapps/ncWMS/WEB-INF/web.xml && \
cp /ncWMS/config/setenv.sh $CATALINA_HOME/bin/setenv.sh && \
cp /ncWMS/config/ecache.xml $CATALINA_HOME/conf/ecache.xml && \
cp /ncWMS/config/tomcat-users.xml $CATALINA_HOME/conf/tomcat-users.xml && \
mkdir -p $CATALINA_HOME/conf/Catalina/localhost/ && \
cp /ncWMS/config/ncWMS.xml $CATALINA_HOME/conf/Catalina/localhost/ncWMS.xml && \
mkdir -p $CATALINA_HOME/.ncWMS2 && \
cp /ncWMS/config/config.xml $CATALINA_HOME/.ncWMS2/config.xml
ENTRYPOINT ["/ncWMS/entrypoint.sh"]
EXPOSE 8080 8443 9090
CMD ["catalina.sh", "run"]