Skip to content
Permalink
Newer
Older
100644 137 lines (122 sloc) 7.15 KB
Oct 13, 2017
1
FROM ubuntu:trusty
2
3
MAINTAINER "TIER API & EntReg Working Group <tier-api@internet2.edu>"
4
5
ENV JAVA_HOME=/opt/jdk-home \
6
ANT_HOME=/opt/ant \
7
PATH=$PATH:$JAVA_HOME/bin:/opt/container-scripts:$ANT_HOME/bin \
8
GROUPER_VERSION=2.3.0 \
9
tomcat_version=8.0.45
10
11
RUN apt-get update \
12
&& DEBIAN_FRONTEND=noninteractive apt-get install -y wget tar unzip dos2unix expect vim
13
14
RUN set -x; \
15
java_version=8.0.131; \
16
zulu_version=8.21.0.1; \
17
java_md5_hash=1931ed3beedee0b16fb7fd37e069b162; \
18
tomcat_version=8.0.45; \
19
tomcat_sha1_hash=ed27fc0564bafd5a81a6975b9aa6dd29101d8ff8; \
20
ant_version=1.10.1; \
21
ant_sha1_hash=fa9acb3b1987f8acf2aa7a87894d1fd9da80e871; \
22
\
23
echo 'Downloading the JDK...' \
24
&& wget -q http://cdn.azul.com/zulu/bin/zulu$zulu_version-jdk$java_version-linux_x64.tar.gz \
25
&& echo 'Downloading Tomcat...'\
26
&& wget -q https://archive.apache.org/dist/tomcat/tomcat-8/v$tomcat_version/bin/apache-tomcat-$tomcat_version.zip \
27
&& echo 'Downloading Ant...'\
28
&& wget -q https://archive.apache.org/dist/ant/binaries/apache-ant-$ant_version-bin.zip \
29
&& echo 'Downloading grouper installer...'\
30
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouperInstaller.jar \
31
&& echo 'Downloading grouper API...'\
32
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.apiBinary-$GROUPER_VERSION.tar.gz \
33
&& echo 'Downloading grouper UI...'\
34
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.ui-$GROUPER_VERSION.tar.gz \
35
&& echo 'Downloading grouper Web Services...'\
36
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.ws-$GROUPER_VERSION.tar.gz \
37
&& echo 'Downloading grouper client...'\
38
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.clientBinary-$GROUPER_VERSION.tar.gz \
39
&& echo 'Downloading grouper PSP...'\
40
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.psp-$GROUPER_VERSION.tar.gz \
41
&& echo 'Downloading grouper PSPNG...'\
42
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/grouper.pspng-$GROUPER_VERSION.tar.gz \
43
&& echo 'Downloading grouper Quickstart...'\
44
&& wget -q http://software.internet2.edu/grouper/release/$GROUPER_VERSION/quickstart.xml \
45
\
46
&& echo "$java_md5_hash zulu$zulu_version-jdk$java_version-linux_x64.tar.gz" | md5sum -c - \
47
&& tar -zxvf zulu$zulu_version-jdk$java_version-linux_x64.tar.gz -C /opt \
48
&& rm zulu$zulu_version-jdk$java_version-linux_x64.tar.gz \
49
&& ln -s /opt/zulu$zulu_version-jdk$java_version-linux_x64/ /opt/jdk-home \
50
\
51
&& echo "$tomcat_sha1_hash apache-tomcat-$tomcat_version.zip" | sha1sum -c - \
52
&& unzip apache-tomcat-$tomcat_version.zip -d /opt 1>/dev/null \
53
&& rm -r apache-tomcat-$tomcat_version.zip /opt/apache-tomcat-$tomcat_version/webapps/* \
54
&& ln -s /opt/apache-tomcat-$tomcat_version /opt/tomcat \
55
\
56
&& unzip apache-ant-$ant_version-bin.zip -d /opt 1>/dev/null \
57
&& echo "$ant_sha1_hash apache-ant-$ant_version-bin.zip" | sha1sum -c - \
58
&& rm -r apache-ant-$ant_version-bin.zip /opt/apache-ant-$ant_version/manual/ \
59
&& ln -s /opt/apache-ant-$ant_version /opt/ant \
60
&& chmod +x /opt/apache-ant-$ant_version/bin/ant \
61
\
62
&& tar -zxf grouper.apiBinary-$GROUPER_VERSION.tar.gz -C /opt \
63
&& tar -zxf grouper.ui-$GROUPER_VERSION.tar.gz -C /opt \
64
&& tar -zxf grouper.ws-$GROUPER_VERSION.tar.gz -C /opt \
65
&& tar -zxf grouper.clientBinary-$GROUPER_VERSION.tar.gz -C /opt \
66
&& tar -zxf grouper.psp-$GROUPER_VERSION.tar.gz -C /opt \
67
&& tar -zxf grouper.pspng-$GROUPER_VERSION.tar.gz -C /opt \
68
69
&& cp -R /opt/grouper.psp-$GROUPER_VERSION/lib/custom/* /opt/grouper.apiBinary-$GROUPER_VERSION/lib/custom \
70
&& cp -R /opt/grouper.pspng-$GROUPER_VERSION/lib/custom/* /opt/grouper.apiBinary-$GROUPER_VERSION/lib/custom \
71
&& cp -R /opt/grouper.pspng-$GROUPER_VERSION/dist/* /opt/grouper.apiBinary-$GROUPER_VERSION/lib/grouper \
72
&& rm grouper.apiBinary-$GROUPER_VERSION.tar.gz grouper.ui-$GROUPER_VERSION.tar.gz grouper.ws-$GROUPER_VERSION.tar.gz grouper.psp-$GROUPER_VERSION.tar.gz grouper.clientBinary-$GROUPER_VERSION.tar.gz
73
74
75
COPY opt/ /opt/
76
77
RUN set -x; \
78
chmod -R +x /opt/container-scripts/; \
79
chmod -R +x /opt/apache-tomcat-$tomcat_version/bin/*.sh; \
80
JAVA_HOME=/opt/jdk-home; \
81
echo Building the wars before patching so embedded api patching works properly \
82
&& mkdir /opt/webapps \
83
&& cd /opt/grouper.ui-$GROUPER_VERSION \
84
&& /opt/ant/bin/ant war \
85
&& cp dist/grouper.war /opt/webapps \
86
&& cd /opt/grouper.ws-$GROUPER_VERSION/grouper-ws/ \
87
&& /opt/ant/bin/ant dist \
88
&& cp build/dist/grouper-ws.war /opt/webapps \
89
&& echo Extracting Tomcats war files for patching \
90
&& mkdir /opt/webapps/grouper/ /opt/webapps/grouper-ws/ \
91
&& cd /opt/webapps/grouper \
92
&& $JAVA_HOME/bin/jar xvf ../grouper.war \
93
&& cd /opt/webapps/grouper-ws \
94
&& $JAVA_HOME/bin/jar xvf ../grouper-ws.war \
95
&& cd /opt/grouper.apiBinary-$GROUPER_VERSION \
96
#&& bin/gsh -registry -check -runscript -noprompt \
97
&& mkdir /tmp/grp-api/ /tmp/grp-ui/ /tmp/grp-psp/ /tmp/grp-pspng/ /tmp/grp-ws/ \
98
&& cd / \
99
# Patch everything we either just downloaded or built above.
100
&& cp /opt/patch-scripts/grouper.installer-api.properties /grouper.installer.properties \
101
&& $JAVA_HOME/bin/java -cp .:/grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller \
102
# bootstrap on container start as required.
103
#&& cd /opt/grouper.apiBinary-$GROUPER_VERSION \
104
#&& bin/gsh -registry -check -runscript -noprompt \
105
#&& bin/gsh /bootstrap.gsh \
106
#&& bin/gsh /pspng.gsh \
107
&& cd / \
108
&& cp /opt/patch-scripts/grouper.installer-psp.properties /grouper.installer.properties \
109
&& $JAVA_HOME/bin/java -cp .:/grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller \
110
&& cp /opt/patch-scripts/grouper.installer-pspng.properties /grouper.installer.properties \
111
&& $JAVA_HOME/bin/java -cp .:/grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller \
112
&& cp /opt/patch-scripts/grouper.installer-ui.properties /grouper.installer.properties \
113
&& $JAVA_HOME/bin/java -cp .:/grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller \
114
&& cp /opt/patch-scripts/grouper.installer-ws.properties /grouper.installer.properties \
115
&& $JAVA_HOME/bin/java -cp .:/grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller \
116
&& rm -fr /tmp/grp-ui/ /tmp/grp-api/ /tmp/grp-psp/ /tmp/grp-pspng/ /tmp/grp-ws/
117
118
# Grouper SCIM Stuff
119
#
120
# not using SCIM...did not have all the necessary endpoints available yet
121
#
122
#COPY scim/grouper-ws-scim /opt/webapps/grouper-ws-scim
123
#RUN set -x; \
124
# cp -rv /opt/grouper.apiBinary-$GROUPER_VERSION/conf/. /opt/webapps/grouper-ws-scim/WEB-INF/classes/
125
126
127
# Indicate the container needs bootstrapping
128
RUN touch /FIRSTRUN
129
130
# TODO: Apache proxy in front of tomcat. set tomcat up on AJP
131
132
COPY run-grouper.sh /usr/local/bin/
133
COPY seed-data/ /opt/bootstrap
134
135
EXPOSE 8080
136
137
CMD ["/bin/bash", "/usr/local/bin/run-grouper.sh"]
You can’t perform that action at this time.