forked from PDOK/geowebcache-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
generate-tomcat-dockerfile.sh
executable file
·40 lines (30 loc) · 1.58 KB
/
generate-tomcat-dockerfile.sh
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
#!/usr/bin/env bash
cat <<EOF
FROM tomcat:$TOMCAT_VERSION
MAINTAINER PDOK
ENV DEBIAN_FRONTEND noninteractive
ENV _POSIX2_VERSION 199209
RUN echo "deb http://httpredir.debian.org/debian jessie non-free" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y apt-utils \
&& apt-get install -y libjai-core-java libjai-imageio-core-java \
&& rm -rf /var/lib/apt/lists/
# jai + imageio:
RUN ln -s /usr/share/java/jai_core.jar /usr/local/tomcat/lib/jai_core.jar && \
ln -s /usr/share/java/jai_codec.jar /usr/local/tomcat/lib/jai_codec.jar && \
ln -s /usr/share/java/mlibwrapper_jai.jar /usr/local/tomcat/lib/mlibwrapper_jai.jar && \
ln -s /usr/share/java/jai_imageio.jar /usr/local/tomcat/lib/jai_imageio.jar && \
ln -s /usr/share/java/clibwrapper_jiio.jar /usr/local/tomcat/lib/clibwrapper_jiio.jar
RUN wget -O /tmp/geowebcache.zip https://sourceforge.net/projects/geowebcache/files/geowebcache/$GWC_VERSION/geowebcache-$GWC_VERSION-war.zip/download \
&& unzip /tmp/geowebcache.zip -d /tmp/ \
&& unzip /tmp/geowebcache.war -d /opt/geowebcache \
&& rm /tmp/geowebcache.zip && rm /tmp/geowebcache.war
ADD geowebcache_context.xml /usr/local/tomcat/conf/Catalina/localhost/geowebcache.xml
# SET geowebcache.xml location to /config
RUN mkdir /config && chmod a+rw /config \
&& sed -i.bak "1,20 s/<constructor-arg ref=\"gwcDefaultStorageFinder\" \/>/<constructor-arg value=\"\/config\" \/>/g" /opt/geowebcache/WEB-INF/geowebcache-core-context.xml
# SET CACHE_DIR
RUN mkdir /cache && chmod a+rw /cache
ENV GEOWEBCACHE_CACHE_DIR /cache
VOLUME /config /cache
EOF