Add multistage docker build

This commit is contained in:
Derry Hamilton 2019-06-12 16:21:28 +01:00
parent 3bfc9d6a1b
commit ea629b3098
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,23 @@
FROM centos:centos7 as builder
RUN yum -y install epel-release java-1.8.0-openjdk-devel
RUN yum -y groupinstall 'Development Tools'
RUN yum -y install git maven
RUN git clone https://github.com/rasilon/ujetl.git
RUN cd ujetl && mvn package
FROM centos:centos7
MAINTAINER Derry Hamilton <derryh@rasilon.net>
RUN yum -y install epel-release
RUN yum -y install java-1.8.0-openjdk-devel
RUN mkdir -p /usr/share/ujetl/lib/ /var/ujetl /etc/ujetl
COPY --from=builder /ujetl/target/CopyingApp-2.*-jar-with-dependencies.jar /usr/share/ujetl/lib/CopyingApp.jar
COPY --from=builder /ujetl/install_extra/copying_defaults_log4j.xml /etc/ujetl/
COPY ujetl_entrypoint /
ENTRYPOINT ["/ujetl_entrypoint"]

View file

@ -0,0 +1,17 @@
#!/bin/bash
set -e
LOG_PROPS=/etc/ujetl/copying_defaults_log4j.xml
cd /var/ujetl
for file in *.xml
do
/usr/bin/java \
-Xms1g \
-Xmx2g \
-cp /usr/share/ujetl/lib/CopyingApp.jar \
com.rasilon.ujetl.CopyingApp \
--log4j "$LOG_PROPS" \
--config "$file"
done