forked from RedHatTraining/DO288-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
28 lines (18 loc) · 835 Bytes
/
Containerfile
File metadata and controls
28 lines (18 loc) · 835 Bytes
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
FROM registry.access.redhat.com/ubi8/ubi:8.0
MAINTAINER Red Hat Training <training@redhat.com>
# command line options to pass to the JVM
ENV JAVA_OPTIONS -Xmx512m
# Install the Java runtime, create a user for running the app, and set permissions
RUN yum install -y --disableplugin=subscription-manager java-1.8.0-openjdk-headless && \
yum clean all --disableplugin=subscription-manager -y && \
useradd wildfly && \
mkdir -p /opt/app-root/bin
# Copy the runnable fat JAR to the container.
ADD https://github.com/RedHatTraining/DO288-apps/releases/download/OCP-4.1-1/hello-java.jar /opt/app-root/bin/
COPY run-app.sh /opt/app-root/bin/
RUN chown -R wildfly:wildfly /opt/app-root && \
chmod -R 700 /opt/app-root
EXPOSE 8080
USER wildfly
# Run the fat JAR
CMD /opt/app-root/bin/run-app.sh