Docker Community Forums

Share and learn in the Docker community.

Dockerize JBoss


Hi everyone,

I want to Dockerize JBoss, but have some question about it:
1-do I need OS image like centos or apline?
2-can I download openjdk image and add JBoss files in this image? is this correct way?
3-should separate JBoss and openjdk image? is it possible or I should put them in single image?
4-is the any performance issue when I use JBoss? (I ask this because only image of WildFly available in docker hub)
5-is it possible to define some pre-input that ask when container start and after user enter them store them in JBoss config file in container and after that run it with new config file?


(Metin Y.) #2

Which exact Jboss product are you aiming for?
What is wrong with the official images?

1- yes, you need to pick a distrubution. Usualy the base images include “just enough OS” and you need to install/confiure every yourself on top of it.

2&3- You could, but usualy you start with an os base image, create a dedicated image with java based on the base image, create a WildFly image based on your java image… and so on. At a later point in time, you could create a Tomcat image using your java image as the base…

4- The containerization overhead is marely noticable

5- Instead of terminal interaction, you usualy define environment variables when creating the container, which usualy are processed by entrypoint scripts that do the magic: setup datasources, modify parts of the configuration, whatever you can dream of. Though, It is up to you how you design and implement the entrypoint scripts…

In our project we use wildfly as well:

  • Base image
    – Java image, based on base image (install java)
    – Wildfly image, based on Java image (install and configure Wildfly, add entrypoint script to configure and start wildfly)c
    — Flyway image, based on Wilfly image (install flyway, add entrypoint script to run flyway, then delegate to wildfily entrypoint scripts)
    ----- Application Image, based on Flyway (add war-files, extract Flyway-migration scripts, delegate to Flyway enrypoint scripts)

At the end we have an entrypoint script that calls other entrypoint scripts to configures and executes database migrations, modifes the datasource(s) and configures other parts of the config and starts wildfly.

– do not bother to dynamicly add datasources with the jboss console

– you might want to create a template for your configuration files and render the target config file using the environment variables (don’t forge default values). If you need dynamic rendering (to support 1 to n datasource for instance), take a look at Dockerize.


Hi Dear Meyay,
my product Product name: EAP, Product version: 6.4.0.GA,Core version: 2.5.5.Final-redhat-1
is there any official images in docker hub for JBoss (not wildfly)? would please give me download link?
1-which distribution do you suggest for base image?
2&3-you mean create two image like this (1-openjdk, 2-JBoss) ? how JBoss use java library that
exist in another container? I’m little confusing about this you mean I should create 3 image like this (1-os,2-openjdk,3-JBoss)?
4-what if I ran 6 instance of JBoss container in a single host?
5-so I need to create entrypoint scripts.
please explain more about your project, each step that you mention add a new layer to image ? or each step is dedicate image and container?
6-about last entrypoint scripts, this script able to effect previous steps? (ask because you mention it calls other entrypoint scripts).
7-sure i will create a template in the next step.


(Metin Y.) #4

I intended to point you in a direction… which obviosuly was not realy successful.

Since you run an EAP stack you might want to open a support ticket at Redhat/JBoss. They should be able to address all your concerns.


1-sure you are point to the right place :wink: I’m newbie in docker world and just want to sure about things.
2-ask them before but they want resolve issue into the JBoss not Docker.
By the way thank you so much for your consideration.