Introduce a separate Java image and base all Java apps on it
This commit is contained in:
parent
5b714d0b10
commit
867a4c06ec
@ -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}
|
||||
|
||||
|
@ -1,15 +1,6 @@
|
||||
FROM alpine:3.7
|
||||
FROM java
|
||||
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 --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 \
|
||||
|
6
java.sh
Executable file
6
java.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOURCE_DIR=$(realpath $(dirname "${0}"))/java
|
||||
|
||||
# Build Docker container
|
||||
docker build -t java ${SOURCE_DIR}
|
13
java/Dockerfile
Normal file
13
java/Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
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/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
|
3
omk.sh
3
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}
|
||||
|
||||
|
@ -1,15 +1,6 @@
|
||||
FROM alpine:3.7
|
||||
FROM java
|
||||
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 --no-cache del paxctl
|
||||
|
||||
RUN \
|
||||
# Install NodeJS runtime
|
||||
apk --no-cache add nodejs paxctl \
|
||||
|
3
solr.sh
3
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}
|
||||
|
||||
|
@ -1,15 +1,6 @@
|
||||
FROM alpine:3.7
|
||||
FROM java
|
||||
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 --no-cache del paxctl
|
||||
|
||||
RUN \
|
||||
# Install runtime dependencies
|
||||
apk --no-cache add bash lsof
|
||||
|
@ -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}
|
||||
|
@ -1,17 +1,6 @@
|
||||
FROM alpine:3.7
|
||||
FROM java
|
||||
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/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 \
|
||||
|
Loading…
Reference in New Issue
Block a user