Getting started with Docker and WildFly

This is the first of a set of tutorials about the Docker framework. In this one we will learn how to install the Docker platform on a Linux Centos machine and pull and execute a WildFly image on the top of it.

First of all, what is Docker ? Docker is a container-based software framework for automating deployment of applications. “Containers” are encapsulated, lightweight, and portable application modules. The major (intended) benefit of using a container is that your application will run consistently on and between any server, be it cloud or dedicated, or of varying operating systems.

Centos 6 or 7 ?

The Docker package is provided by default as part of CentOS-7. If you are running the CentOS 6.5 like me, you have to install the EPEL repository. You can find all details concerning the EPEL installation here:

In my case I’ve installed the EPEL repository as follows:

rpm -iUvh

Then, as a matter of best practice, we’ll update our packages:

yum update -y

Installing Docker

Done with EPEL, let’s install Docker by installing the docker-io package:

yum -y install docker-io

Once Docker is installed, you will need to start the docker daemon.

[jboss@localhost ~] $ sudo service docker start

Starting cgconfig service:                                 [  OK  ]

Starting docker:                                       [  OK  ]

Great! now your Docker is ready to rock!

Pulling Docker images

As next step, we will start pulling Docker images. The recommended repository for Docker images of WildFly is

We will demonstrate how to install and run a wildfly vanilla Docker image. In order to do that issue the following command:

[jboss@localhost ~]$ docker pull

Once completed downloading the image, we will verify the available images in our Docker platform:

$ docker images | grep wildfly             latest                        0ed0b7d75892        6 months ago        1.06 GB

In order to start the wildfly application server, simply issue:

[jboss@localhost ~]$ docker run -it
4:41:33,725 INFO  [] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on
14:41:33,725 INFO  [] (Controller Boot Thread) WFLYSRV0051: Admin console listening on
14:41:33,725 INFO  [] (Controller Boot Thread) WFLYSRV0025: WildFly Full 19.0.0.Final started in 5854ms - Started 391 of 576 services (324 services are lazy, passive or on-demand)

Seems the server started correclty. We can check it by issuing the docker ps command which retrieves the images process which are running and the ports engaged by the process:

[jboss@localhost ~]$ sudo docker ps

CONTAINER ID        IMAGE                  COMMAND                CREATED             STATUS              PORTS                NAMES

cac63ed21d67   "/opt/jboss/wildfly/   3 minutes ago       Up 3 minutes        8080/tcp, 9990/tcp   happy_newton    

If you have notices the startup log of the server, you should have discovered that the server is located in the /opt/jboss/wildfly and that by default the public interfaces are bound to the address whilst the admin interfaces are bound just to localhost. This information will be useful to learn how to customize the server.

So, in order to access to our wildfly server, we need to know which address has been chosen by the application server for socket binding. We will use the docker inspect command passing as parameter the ID of the Container we have already found (cac63ed21d67):

[jboss@localhost ~]$ sudo docker inspect -f ‘{{ .NetworkSettings.IPAddress }}’ cac63ed21d67

The above command will output:

So the server is available at the IP Address. Now let’s open the console at that address:

wildfly docker tutorial wildfly docker tutorial


Et volià! WildFly served on a Docker image.

Continue reading in the next tutorial where we will learn how to customize the Docker image installation and deploy some applications on the top of it: Deploying applications on your Docker WildFly image