# By default, build on JDK 17 on CentOS 7. ARG jdk=17 # Red Hat UBI 9 (ubi9-minimal) should be used on JDK 20 and later. ARG dist=centos7 FROM eclipse-temurin:${jdk}-${dist} LABEL org.opencontainers.image.source=https://github.com/jboss-dockerfiles/wildfly org.opencontainers.image.title=wildfly org.opencontainers.imag.url=https://github.com/jboss-dockerfiles/wildfly org.opencontainers.image.vendor=WildFly WORKDIR /opt/jboss RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \ chmod 755 /opt/jboss # Set the WILDFLY_VERSION env variable ENV WILDFLY_VERSION 31.0.1.Final ENV WILDFLY_SHA1 f3dc65a92698173a36fa96b082eed5521f5f8494 ENV JBOSS_HOME /opt/jboss/wildfly USER root # Add the WildFly distribution to /opt, and make wildfly the owner of the extracted tar content # Make sure the distribution is available from a well-known place RUN cd $HOME \ && curl -L -O https://github.com/wildfly/wildfly/releases/download/$WILDFLY_VERSION/wildfly-$WILDFLY_VERSION.tar.gz \ && sha1sum wildfly-$WILDFLY_VERSION.tar.gz | grep $WILDFLY_SHA1 \ && tar xf wildfly-$WILDFLY_VERSION.tar.gz \ && mv $HOME/wildfly-$WILDFLY_VERSION $JBOSS_HOME \ && rm wildfly-$WILDFLY_VERSION.tar.gz \ && chown -R jboss:0 ${JBOSS_HOME} \ && chmod -R g+rw ${JBOSS_HOME} # Ensure signals are forwarded to the JVM process correctly for graceful shutdown ENV LAUNCH_JBOSS_IN_BACKGROUND true USER jboss # Expose the ports in which we're interested EXPOSE 8080 # Set the default command to run on boot # This will boot WildFly in standalone mode and bind to all interfaces CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0"]