forked from bcgov/openshift-openjfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
88 lines (69 loc) · 3.46 KB
/
Dockerfile
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# s2i-java
FROM openshift/base-centos7
MAINTAINER Jorge Morales <[email protected]>
# HOME in base image is /opt/app-root/src
# Install build tools on top of base image
# Java jdk 8, Maven 3.3, Gradle 2.6
RUN INSTALL_PKGS="tar unzip bc which lsof java-1.8.0-openjdk java-1.8.0-openjdk-devel" && \
yum install -y --enablerepo=centosplus $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y && \
mkdir -p /opt/openshift && \
mkdir -p /opt/app-root/source && chmod -R a+rwX /opt/app-root/source && \
mkdir -p /opt/s2i/destination && chmod -R a+rwX /opt/s2i/destination && \
mkdir -p /opt/app-root/src && chmod -R a+rwX /opt/app-root/src
ENV MAVEN_VERSION 3.3.9
RUN (curl -0 http://www.eu.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | \
tar -zx -C /usr/local) && \
mv /usr/local/apache-maven-$MAVEN_VERSION /usr/local/maven && \
ln -sf /usr/local/maven/bin/mvn /usr/local/bin/mvn && \
mkdir -p $HOME/.m2 && chmod -R a+rwX $HOME/.m2
ENV GRADLE_VERSION 2.6
RUN curl -sL -0 https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -o /tmp/gradle-${GRADLE_VERSION}-bin.zip && \
unzip /tmp/gradle-${GRADLE_VERSION}-bin.zip -d /usr/local/ && \
rm /tmp/gradle-${GRADLE_VERSION}-bin.zip && \
mv /usr/local/gradle-${GRADLE_VERSION} /usr/local/gradle && \
ln -sf /usr/local/gradle/bin/gradle /usr/local/bin/gradle
ENV PATH=/opt/maven/bin/:/opt/gradle/bin/:$PATH
ENV BUILDER_VERSION 1.0
LABEL io.k8s.description="Platform for building Java (fatjar) applications with maven or gradle" \
io.k8s.display-name="Java S2I builder 1.0" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,maven-3,gradle-2.6,java,microservices,fatjar"
# TODO (optional): Copy the builder files into /opt/openshift
# COPY ./<builder_folder>/ /opt/openshift/
# COPY Additional files,configurations that we want to ship by default, like a default setting.xml
COPY ./contrib/settings.xml $HOME/.m2/
# build Open JFX
RUN wget https://chriswhocodes.com/downloads/openjfx-8u60-sdk-overlay-linux-amd64.zip
# extract the archive to /usr/lib/jvm/java-1.8.0
RUN unzip openjfx-8u60-sdk-overlay-linux-amd64.zip -d /usr/lib/jvm/java-1.8.0
# Install X11
RUN INSTALL_PKGS="xorg-x11-server-Xvfb" && \
yum install -y --enablerepo=centosplus $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum clean all -y
# Install Wildfly 10
ENV WILDFLY_VERSION=10.1.0.Final
RUN mkdir -p /wildfly && \
(curl -v https://download.jboss.org/wildfly/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz | tar -zx --strip-components=1 -C /wildfly) && \
mkdir -p /opt/s2i/destination
# Add s2i wildfly customizations
ADD ./contrib/wfmodules/ /wildfly/modules/
ADD ./contrib/wfbin/standalone.conf /wildfly/bin/standalone.conf
ADD ./contrib/wfcfg/standalone.xml /wildfly/standalone/configuration/standalone.xml
LABEL io.openshift.s2i.scripts-url=image:///usr/local/sti
COPY ./sti/bin/ /usr/local/sti
RUN chown -R 1001:1001 /opt/openshift
RUN mkdir -p /wildfly/standalone/log
RUN mkdir -p /wildfly/standalone/data
RUN chown -R 1001:0 /wildfly && \
chmod -R ug+rw /wildfly && \
chmod -R g+rw /opt/s2i/destination
# This default user is created in the openshift/base-centos7 image
USER 1001
# Set the default port for applications built using this image
EXPOSE 8080
# Set the default CMD for the image
# CMD ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/opt/openshift/app.jar"]
CMD ["usage"]