Public | Automated Build

Last pushed: a month ago
Short Description
WildFly application server image.
Full Description

imixs/wildfly

This imixs/wildfly Docker image runs the Java application server WildFly in the latest version on OpenJDK 8.
The image is based on Debian/Jessie and is a little bit smaller than the official JBoss/Wildfly image. The Dockerfile was inspired by this image.

In addition the imixs wildfly image adds the eclipselink.jar into the module configuration of wildfly and JDBC driver support for PostgreSQL.

Features

  • inherit form debian:jessie
  • runs wildfly with OpenJDK 8
  • starts wildfly in standalone mode with management console
  • creates an admin user on first usage
  • adds support of eclipselink
  • provides JDBC PostgreSQL driver
  • installation path: /opt/wildfly
  • linux user: imixs

Environment

imixs/wildfly provides the following environment variables

<div>
<ul>
<li>JAVA_HOME</li>
<li>WILDFLY_HOME (/opt/wildfly)</li>
<li>WILDFLY_DEPLOYMENT ($WILDFLY_HOME/standalone/deployments)</li>
<li>WILDFLY_CONFIG ($WILDFLY_HOME/standalone/configuration)</li>
</ul>
</div>

1. Install Docker

Follow the Docker installation instructions for your host system.

2. Running and stopping a container

The container includes a start script which allows to start Wildfly with an admin password to grant access to the web admin console. You can start an instance of wildfly with the Docker run command:

docker run --name="wildfly" -d -p 8080:8080 -p 9990:9990 -e WILDFLY_PASS="admin_password" imixs/wildfly

If you leave the environment parameter 'WILDFLY_PASS' empty, the start script will generate a random password.
If you expose the ports 8080 and 9990 you can access Wildfly via http://<host-ip>:8080/ and http://<host-ip>:9990/

To stop and remove the Docker container run the Docker command:

docker stop wildfly && docker rm wildfly

3. Access WildFly

To follow the wildfly server log:

docker logs -f wildfly

To access the wildfly commandline tool (CLI) run:

docker exec -it wildfly /opt/wildfly/bin/jboss-cli.sh -c -u=admin -p=a_password

To access the shell:

docker exec -it wildfly /bin/bash    

How to bind external volumes

If you want to customize the configuration or deploy applications you can do so by defining external volumes at the following locations:

  • /opt/wildfly/standalone/configuration/ => for custom configuration files like standalone.xml
  • /opt/wildfly/standalone/deployments/ => to provide an external autodeploy directory.

This is an example to run imixs/wildfly with external volumes:

 docker run --name="wildfly" -d -p 8080:8080 -p 9990:9990 \
         -e WILDFLY_PASS="admin_password" \
         -v /path/to/deployments:/opt/wildfly/standalone/deployments/:rw \
         imixs/wildfly

The ':rw' at the end of the deployments path is important, otherwise the docker container cannot write to mark successfully or failed deployments.
You can now place a .war or .ear file into the deployments directory to be picked up by the wildfly deployment scanner.

Also an external configuration volume can be bound to the container:

 docker run --name="wildfly" -d -p 8080:8080 -p 9990:9990 \
         -e WILDFLY_PASS="admin_password" \
         -v ~/git/imixs-office-workflow/src/docker/imixs/config/deployments:/opt/wildfly/standalone/deployments/ \
         -v ~/git/imixs-office-workflow/src/docker/imixs/config/configuration/:/opt/wildfly/standalone/configuration/ \
         imixs/wildfly

To start wildfly with a volumes shared from another application volume container (e.g. imixs/office) run:

 docker run --name="wildfly" -d -p 8080:8080 -p 9990:9990 \
         -e WILDFLY_PASS="admin_password" \
         --volumes-from my_data_container \
         imixs/wildfly

Linking containers

For Java enterprise applications you often need an additional database server. you can link the wildfly container to such an external container. The following example creates a link to a postgreSQL container with the name 'postgres', which is the host name to be used in a database-pool configuration:

 docker run --name="wildfly" -d -p 8080:8080 -p 9990:9990 \
         -e WILDFLY_PASS="admin_password" \
         --link database-postgres:postgres \
         imixs/wildfly

Debug Mode

To run the container in debug mode the environment parameter 'DEBUG' can be set to 'true'.
Note: You need to expose the port 8787 to attache a debugger tool.

docker run --name="wildfly" -p 8080:8080 -p 8787:8787 -p 9990:9990 -e WILDFLY_PASS="admin_password" -e DEBUG=true imixs/wildfly

Contribute

The source is available on Github. Please report any issues.

To build the image from the Dockerfile run:

docker build --tag=imixs/wildfly .

To test the image run the container

docker run --name="wildfly" -p 8080:8080 -p 9990:9990 -e WILDFLY_PASS="admin_password" imixs/wildfly
docker exec -it wildfly /bin/bash    

To remove the image run

docker rmi wildfly
Docker Pull Command
Owner
imixs
Source Repository

Comments (0)