Skip to content

Commit f2ee1ea

Browse files
authored
Add dockerfile for wildfly (linux-on-ibm-z#21)
* Create LICENSE * Create Dockerfile * Create README.md
1 parent f5ecae7 commit f2ee1ea

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.3
2+
3+
RUN microdnf install --best --nodocs -y tar gzip zip shadow-utils && microdnf clean all
4+
5+
WORKDIR /opt/jboss
6+
7+
RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
8+
chmod 755 /opt/jboss
9+
10+
# Set the PACKAGE_VERSION env variable
11+
ENV PACKAGE_VERSION 32.0.0.Final
12+
ENV WILDFLY_SHA1=9b6d762aa4662045fc3e7329a1ed1c0d457daf6d
13+
ENV JBOSS_HOME /opt/jboss/wildfly
14+
15+
USER root
16+
17+
# Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content
18+
# Make sure the distribution is available from a well-known place
19+
RUN cd $HOME \
20+
&& curl -L -O https://github.com/wildfly/wildfly/releases/download/$PACKAGE_VERSION/wildfly-$PACKAGE_VERSION.tar.gz \
21+
&& sha1sum wildfly-$PACKAGE_VERSION.tar.gz | grep $WILDFLY_SHA1 \
22+
&& tar -xf wildfly-$PACKAGE_VERSION.tar.gz \
23+
&& mv $HOME/wildfly-$PACKAGE_VERSION $JBOSS_HOME \
24+
&& rm wildfly-$PACKAGE_VERSION.tar.gz \
25+
&& chown -R jboss:0 ${JBOSS_HOME} \
26+
&& chmod -R g+rw ${JBOSS_HOME}
27+
28+
# Ensure signals are forwarded to the JVM process correctly for graceful shutdown
29+
ENV LAUNCH_JBOSS_IN_BACKGROUND true
30+
31+
USER jboss
32+
33+
# Expose the ports in which we're interested
34+
EXPOSE 8080
35+
36+
# Set the default command to run on boot
37+
# This will boot WildFly in standalone mode and bind to all interfaces
38+
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To build a Dockerfile: docker build -t wildlfy .
2+
3+
To run a dockerfile: docker run -it -p 8080:8080 -p 9990:9990 -d wildlfy

0 commit comments

Comments
 (0)