Red Hat Training

A Red Hat training course is available for Red Hat JBoss Enterprise Application Platform

Chapter 2. Container Quick Start

If you are familiar with the concepts behind Linux Containers and have Docker installed and configured, here is everything you need to pull the JBoss EAP 7 image from the Red Hat Docker Registry and start a container with a JBoss EAP instance running:

Pull and Start a Base JBoss EAP Instance

$ docker pull registry.access.redhat.com/jboss-eap-7-tech-preview/eap70

$ docker run -p 8080:8080 registry.access.redhat.com/jboss-eap-7-tech-preview/eap70

Note

By default, the JBoss EAP image ships with only the public interface bound to 0.0.0.0 (-b 0.0.0.0). See the Extending the Image section for more details on binding to additional interfaces and publishing those ports.

Example Dockerfile for Binding the Management Interface

FROM registry.access.redhat.com/jboss-eap-7-tech-preview/eap70
EXPOSE 9990
CMD ["/opt/eap/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]

Example Dockerfile for Creating an Admin User

FROM registry.access.redhat.com/jboss-eap-7-tech-preview/eap70
RUN $JBOSS_HOME/bin/add-user.sh adminUser StrongPassword#1 --silent

Example Dockerfile for Executing a CLI Batch Script

FROM registry.access.redhat.com/jboss-eap-7-tech-preview/eap70
COPY my-commands.txt $JBOSS_HOME
USER root
RUN chown jboss:jboss $JBOSS_HOME/my-commands.txt
USER jboss
RUN $JBOSS_HOME/bin/jboss-cli.sh --commands=embed-server,run-batch\ --file=$JBOSS_HOME/my-commands.txt,stop-embedded-server

Example Dockerfile for Deploying an Application Using the Deployment Scanner

FROM registry.access.redhat.com/jboss-eap-7-tech-preview/eap70
COPY app.war $JBOSS_HOME/standalone/deployments/
USER root
RUN chown jboss:jboss $JBOSS_HOME/standalone/deployments/app.war
USER jboss