WildFly is a modular & lightweight application server based on the Jakarta EE standard.
You can start a Wildfly Sever with the help of Docker quite simple. To start a blank wildfly server in its standard configuration run:
$ docker run -it quay.io/wildfly/wildfly
Bundle Your Application
If you want to bundle your own application you just need a simple Docker file like this:
FROM quay.io/wildfly/wildfly:26.0.0.Final COPY ./target/*.war /opt/jboss/wildfly/standalone/deployments/
This will copy your web application or microservice from a maven project into the Wildfly deployment directory. The applicaton will be be automatically deployed during startup.
Wildfly & Microprofile
Wildfly comes with different configuration profiles (e.g. cluster mode, full version, microprofile). These configuration files are located in the server directory
To start your Wildfly container with one of these configurations – for example with the Eclipse Microprofiles you just need to add a parameter to the startup command, specifying the configuration profile:
FROM quay.io/wildfly/wildfly:26.0.0.Final COPY ./target/*.war /opt/jboss/wildfly/standalone/deployments/ # Run with microprofiles CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c","standalone-microprofile.xml"]
This Dockerfile will now activate the standalone-microprofile.xml configuration during next startup.
Of course you can also customize your configuration. For this purpose just copy one of the standalone-*.xml Files form a running container to your host:
$docker cp [CONTAINER_ID]:/opt/jboss/wildfly/standalone/configuration/standalone.xml ./my-standalone.xml
Replace [CONTAINER_ID] with the ID of your running wildfly container.
Next you can edit the standalone.xml file and add your project specific configurations. Finally add you custom file to the container Image via the
COPY command in your Dockerfile:
FROM quay.io/wildfly/wildfly:26.0.0.Final COPY .my-standalone.xml /opt/jboss/wildfly/standalone/configuration/ COPY ./target/*.war /opt/jboss/wildfly/standalone/deployments/ # Run with custom configuration CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c","my-standalone.xml"]