Create common Tomcat Docker image

This commit is contained in:
Disassembler 2018-01-26 21:58:29 +01:00
parent f3ed426201
commit f07d5e746b
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
9 changed files with 63 additions and 66 deletions

View File

@ -4,6 +4,7 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/mifosx
# Check prerequisites # Check prerequisites
docker image ls | grep -q mariadb || $(realpath $(dirname "${0}"))/mariadb.sh docker image ls | grep -q mariadb || $(realpath $(dirname "${0}"))/mariadb.sh
docker image ls | grep -q tomcat || $(realpath $(dirname "${0}"))/tomcat.sh
# Build Docker container # Build Docker container
docker build -t mifosx ${SOURCE_DIR} docker build -t mifosx ${SOURCE_DIR}

View File

@ -1,26 +1,6 @@
FROM alpine:3.7 FROM tomcat
MAINTAINER Disassembler <disassembler@dasm.cz> MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install Java 1.8 JRE
apk --no-cache add openjdk8-jre-base paxctl \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
# Cleanup
&& apk del paxctl
RUN \
# Install Tomcat 8
wget http://mirror.dkm.cz/apache/tomcat/tomcat-8/v8.0.48/bin/apache-tomcat-8.0.48.tar.gz -O /tmp/apache-tomcat-8.tgz \
&& tar xf /tmp/apache-tomcat-8.tgz -C /srv \
&& mv /srv/apache-tomcat-8.0.48 /srv/tomcat \
# Make catalina.sh available globally
&& ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh \
# Cleanup
&& rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \
&& rm -f /tmp/apache-tomcat-8.tgz
RUN \ RUN \
# Install full-featured wget to work around sourceforge bugs # Install full-featured wget to work around sourceforge bugs
apk --no-cache add wget \ apk --no-cache add wget \

View File

@ -3,9 +3,9 @@
SOURCE_DIR=$(realpath $(dirname "${0}"))/motech SOURCE_DIR=$(realpath $(dirname "${0}"))/motech
# Check prerequisites # Check prerequisites
SCRIPT_DIR=$(realpath $(dirname "${0}")) docker image ls | grep -q activemq || $(realpath $(dirname "${0}"))/activemq.sh
docker image ls | grep -q activemq || ${SCRIPT_DIR}/activemq.sh docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh
docker image ls | grep -q postgres || ${SCRIPT_DIR}/postgres.sh docker image ls | grep -q tomcat || $(realpath $(dirname "${0}"))/tomcat.sh
# Build Docker container # Build Docker container
docker build -t motech ${SOURCE_DIR} docker build -t motech ${SOURCE_DIR}

View File

@ -1,26 +1,6 @@
FROM alpine:3.7 FROM tomcat
MAINTAINER Disassembler <disassembler@dasm.cz> MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install Java 1.8 JRE
apk --no-cache add openjdk8-jre-base paxctl \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
# Cleanup
&& apk del paxctl
RUN \
# Install Tomcat 8
wget http://mirror.dkm.cz/apache/tomcat/tomcat-8/v8.0.48/bin/apache-tomcat-8.0.48.tar.gz -O /tmp/apache-tomcat-8.tgz \
&& tar xf /tmp/apache-tomcat-8.tgz -C /srv \
&& mv /srv/apache-tomcat-8.0.48 /srv/tomcat \
# Make catalina.sh available globally
&& ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh \
# Cleanup
&& rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \
&& rm -f /tmp/apache-tomcat-8.tgz
RUN \ RUN \
# Download Motech # Download Motech
wget http://nexus.motechproject.org/service/local/repositories/releases/content/org/motechproject/motech-platform-server/1.0/motech-platform-server-1.0.war -O /tmp/motech.war \ wget http://nexus.motechproject.org/service/local/repositories/releases/content/org/motechproject/motech-platform-server/1.0/motech-platform-server-1.0.war -O /tmp/motech.war \

View File

@ -4,6 +4,7 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/sigmah
# Check prerequisites # Check prerequisites
docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh docker image ls | grep -q postgres || $(realpath $(dirname "${0}"))/postgres.sh
docker image ls | grep -q tomcat || $(realpath $(dirname "${0}"))/tomcat.sh
# Build Docker container # Build Docker container
docker build -t sigmah ${SOURCE_DIR} docker build -t sigmah ${SOURCE_DIR}

View File

@ -1,26 +1,6 @@
FROM alpine:3.7 FROM tomcat
MAINTAINER Disassembler <disassembler@dasm.cz> MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install Java 1.8 JRE
apk --no-cache add openjdk8-jre-base paxctl \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
# Cleanup
&& apk del paxctl
RUN \
# Install Tomcat 8
wget http://mirror.dkm.cz/apache/tomcat/tomcat-8/v8.0.49/bin/apache-tomcat-8.0.49.tar.gz -O /tmp/apache-tomcat-8.tgz \
&& tar xf /tmp/apache-tomcat-8.tgz -C /srv \
&& mv /srv/apache-tomcat-8.0.49 /srv/tomcat \
# Make catalina.sh available globally
&& ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh \
# Cleanup
&& rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \
&& rm -f /tmp/apache-tomcat-8.tgz
RUN \ RUN \
# Download Sigmah # Download Sigmah
wget https://github.com/sigmah-dev/sigmah/releases/download/v2.0.2/sigmah-2.0.2.war -O /tmp/sigmah.war \ wget https://github.com/sigmah-dev/sigmah/releases/download/v2.0.2/sigmah-2.0.2.war -O /tmp/sigmah.war \

6
tomcat.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
SOURCE_DIR=$(realpath $(dirname "${0}"))/tomcat
# Build Docker container
docker build -t tomcat ${SOURCE_DIR}

24
tomcat/Dockerfile Normal file
View File

@ -0,0 +1,24 @@
FROM alpine:3.7
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install Java 1.8 JRE
apk --no-cache add openjdk8-jre-base paxctl \
# Fix grsec attributes to loosen memory protection restrictions
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \
&& paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/java \
# Cleanup
&& apk del paxctl
RUN \
# Install Tomcat 8
wget http://mirror.dkm.cz/apache/tomcat/tomcat-8/v8.0.49/bin/apache-tomcat-8.0.49.tar.gz -O /tmp/apache-tomcat-8.tgz \
&& tar xf /tmp/apache-tomcat-8.tgz -C /srv \
&& mv /srv/apache-tomcat-8.0.49 /srv/tomcat \
# Make catalina.sh available globally
&& ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh \
# Cleanup
&& rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \
&& rm -f /tmp/apache-tomcat-8.tgz
COPY docker/ /

View File

@ -0,0 +1,25 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
handlers = java.util.logging.ConsoleHandler
.handlers = java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter