diff --git a/activemq.sh b/activemq.sh index 837ffd9..d14f265 100755 --- a/activemq.sh +++ b/activemq.sh @@ -2,6 +2,9 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/activemq +# Check prerequisites +docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh + # Build Docker container docker build -t activemq ${SOURCE_DIR} diff --git a/activemq/Dockerfile b/activemq/Dockerfile index 139b173..38ed240 100644 --- a/activemq/Dockerfile +++ b/activemq/Dockerfile @@ -1,15 +1,6 @@ -FROM alpine:3.7 +FROM java MAINTAINER Disassembler -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 --no-cache del paxctl - RUN \ # Download and install ActiveMQ wget http://archive.apache.org/dist/activemq/5.15.2/apache-activemq-5.15.2-bin.tar.gz -O /tmp/activemq.tgz \ diff --git a/java.sh b/java.sh new file mode 100755 index 0000000..75febc3 --- /dev/null +++ b/java.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +SOURCE_DIR=$(realpath $(dirname "${0}"))/java + +# Build Docker container +docker build -t java ${SOURCE_DIR} diff --git a/java/Dockerfile b/java/Dockerfile new file mode 100644 index 0000000..12d91a8 --- /dev/null +++ b/java/Dockerfile @@ -0,0 +1,13 @@ +FROM alpine:3.7 +MAINTAINER Disassembler + +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/bin/java \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/keytool \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \ + && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/keytool \ + # Cleanup + && apk --no-cache del paxctl diff --git a/omk.sh b/omk.sh index 00567dd..3e68e71 100755 --- a/omk.sh +++ b/omk.sh @@ -2,6 +2,9 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/omk +# Check prerequisites +docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh + # Build Docker container docker build -t omk ${SOURCE_DIR} diff --git a/omk/Dockerfile b/omk/Dockerfile index 6e2f9ce..abef4a1 100644 --- a/omk/Dockerfile +++ b/omk/Dockerfile @@ -1,15 +1,6 @@ -FROM alpine:3.7 +FROM java MAINTAINER Disassembler -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 --no-cache del paxctl - RUN \ # Install NodeJS runtime apk --no-cache add nodejs paxctl \ diff --git a/solr.sh b/solr.sh index c3b58f0..52b62e3 100755 --- a/solr.sh +++ b/solr.sh @@ -2,6 +2,9 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/solr +# Check prerequisites +docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh + # Build Docker container docker build -t solr ${SOURCE_DIR} diff --git a/solr/Dockerfile b/solr/Dockerfile index 379325d..95874e3 100644 --- a/solr/Dockerfile +++ b/solr/Dockerfile @@ -1,15 +1,6 @@ -FROM alpine:3.7 +FROM java MAINTAINER Disassembler -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 --no-cache del paxctl - RUN \ # Install runtime dependencies apk --no-cache add bash lsof diff --git a/tomcat.sh b/tomcat.sh index 5583801..1cd739b 100755 --- a/tomcat.sh +++ b/tomcat.sh @@ -2,5 +2,8 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/tomcat +# Check prerequisites +docker image ls | grep -q java || $(realpath $(dirname "${0}"))/java.sh + # Build Docker container docker build -t tomcat ${SOURCE_DIR} diff --git a/tomcat/Dockerfile b/tomcat/Dockerfile index b570f57..15a0cc7 100644 --- a/tomcat/Dockerfile +++ b/tomcat/Dockerfile @@ -1,17 +1,6 @@ -FROM alpine:3.7 +FROM java MAINTAINER Disassembler -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/bin/java \ - && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/bin/keytool \ - && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/java \ - && paxctl -cm /usr/lib/jvm/java-1.8-openjdk/jre/bin/keytool \ - # Cleanup - && apk --no-cache del paxctl - RUN \ # Install Tomcat 8 wget http://mirror.hosting90.cz/apache/tomcat/tomcat-8/v8.0.50/bin/apache-tomcat-8.0.50.tar.gz -O /tmp/apache-tomcat-8.tgz \