Example Dockerfile Jboss EAP 7 for Deploying an Application
1 min readMay 10, 2018
1.- Create Dockerfile.
$ vi Dockerfile# dockerfile to build image for JBoss EAP 7.1
#start from eap71-openshift
FROM registry.access.redhat.com/jboss-eap-7/eap71-openshift
# file author / maintainer
MAINTAINER "FirstName LastName" "emailaddress@gmail.com"
# Copy war to deployments folder
COPY app.war $JBOSS_HOME/standalone/deployments/
# User root to modify war owners
USER root
# Modify owners war
RUN chown jboss:jboss $JBOSS_HOME/standalone/deployments/app.war
# Important, use jboss user to run image
USER jboss
2.- Modify Dockerfile, for example if you war has other name then, you can change the name, replace app.war for you name war, this war must be to the level at Dockerfile.
3.- Build image.
$ docker build --tag=myuser/myimage:1.0 /path/to/dockerfile
4.- Run image.
$ docker run -d -p 8080:8080 -p 9990:9990 myuser/myimage:1.0
5.- Enjoy, maybe you need to push image to private or public registry, follow the next steps.
$ docker login -u myuser ip-or-domain-registry:port
$ docker tag myuser/myimage:1.0 ip-or-domain-registry:port/myuser/myimage:1.0
$ docker push ip-or-domain-registry:port/myuser/myimage:1.0
This way work to public or private registry.
I hope I’ve helped :)
Chao!