forked from vert-x3/vertx-openshift-s2i
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·50 lines (40 loc) · 2.06 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
FROM openshift/base-centos7
MAINTAINER Clement Escoffier <[email protected]>
# Install build tools on top of base image
ARG GRADLE_VERSION=4.1
ARG MAVEN_VERSION=3.6.3
RUN yum install -y --enablerepo=centosplus \
tar unzip bc which lsof java-1.8.0-openjdk java-1.8.0-openjdk-devel && \
yum clean all -y && \
(curl -0 https://downloads.apache.org/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 && \
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 && \
mkdir -p /opt/openshift && chmod -R a+rwX /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 && \
mkdir -p /opt/.m2 && chmod -R a+rwX /opt/.m2
ENV PATH=/opt/maven/bin/:/opt/gradle/bin/:$PATH M2_LOCAL=/opt/.m2
ENV BUILDER_VERSION 1.0
LABEL io.k8s.description="Platform for building Vert.x applications with maven or gradle" \
io.k8s.display-name="Vert.x 3 builder 1.0" \
io.openshift.expose-services="8080:http" \
io.openshift.tags="builder,maven-3,gradle-4,vert.x"
# COPY ./<builder_folder>/ /opt/openshift/
LABEL io.openshift.s2i.scripts-url=image:///usr/local/s2i
COPY ./.s2i/bin/ /usr/local/s2i
RUN chown -R 1001:1001 /opt/openshift /opt/.m2
RUN chmod -R go+rw /opt/openshift
# This default user is created in the openshift/base-centos7 image
USER 1001
# Set the default port for applications HTTP and event bus
EXPOSE 8080
EXPOSE 5701
# Set the default CMD for the image
CMD ["usage"]