How to test the portability of docker in fedora with JBoss application?

September 22, 2014 2k views

I am a beginner to Docker. I want to test the portability of docker in fedora. I want to create my own image in fedora 19 having Jboss application and try to run this in fedora 20. What I want to do this? Help me with suitable commands.

1 Answer

JBoss provides a set of Docker images that you can use as a base layer for your JBoss application container. They have an overview on their site and you can view their offical images right on Docker Hub. RedHat also has a nice overview.

At its most basic, your Dockerfile might look like:

FROM jboss/wildfly
ADD myapp.war /opt/wildfly/standalone/deployments/

With the war file for your project in the same directory. You could then build it using:

  • docker build -t my-app .

And finally run it with:

  • docker run -it --rm -p 8080:8080 my-app

For information on how to build your own Docker images, check out this tutorial:

by O.S Tezer
Docker containers are created by using [base] images. An image can be a basic one with nothing but the operating-system fundamentals, or it can consist of a sophisticated pre-built application stack - ready for launch. When building your images with docker, each action taken (i.e. a command executed such as apt-get install) forms a new layer on top of the previous one. These base images then can be used to create new containers. In this DigitalOcean article, we will see about automating this process as much as possible, as well as showing you the best practices and methods to make most of docker and containers by using Dockerfiles: scripts to build containers, step-by-step, layer-by-layer, automatically from a source (base) image.
Have another answer? Share your knowledge.