Conteiner docker com Jboss Wildfly rodando sobre a JVM OpenJ9
227
Conteiner docker com WildFly application server rodando sobre a JVM OpenJ9
To boot in standalone mode
docker run -it hermanolira/wildfly-openj9
To boot in standalone mode with admin console available remotely
docker run -p 8080:8080 -p 9990:9990 -it hermanolira/wildfly-openj9 /opt/jboss/wildfly/bin/standalone.sh -bmanagement 0.0.0.0
To boot in domain mode
docker run -it hermanolira/wildfly-openj9 /opt/jboss/wildfly/bin/domain.sh -b 0.0.0.0 -bmanagement 0.0.0.0
With the WildFly server you can deploy your application in multiple ways:
The most popular way of deploying an application is using the deployment scanner. In WildFly this method is enabled by default and the only thing you need to do is to place your application inside of the deployments/ directory. It can be /opt/jboss/wildfly/standalone/deployments/ or /opt/jboss/wildfly/domain/deployments/ depending on which mode you choose (standalone is default in the jboss/wildfly image -- see above).
The simplest and cleanest way to deploy an application to WildFly running in a container started from the jboss/wildfly image is to use the deployment scanner method mentioned above.
To do this you just need to extend the hermanolira/wildfly-openj9 image by creating a new one. Place your application inside the deployments/ directory with the ADD command (but make sure to include the trailing slash on the deployment folder path, more info). You can also do the changes to the configuration (if any) as additional steps (RUN command).
A simple example was prepared to show how to do it, but the steps are following:
Create Dockerfile with following content:
FROM hermanolira/wildfly-openj9
ADD your-awesome-app.war /opt/jboss/wildfly/standalone/deployments/
Place your your-awesome-app.war file in the same directory as your Dockerfile.
Run the build with docker build --tag=wildfly-app .
Run the container with docker run -it wildfly-app. Application will be deployed on the container boot.
This way of deployment is great because of a few things:
Logging can be done in many ways. This blog post describes a lot of them.
Sometimes you need to customize the application server configuration. There are many ways to do it and this blog post tries to summarize it.
To be able to create a management user to access the administration console create a Dockerfile with the following content
FROM hermanolira/wildfly-openj9
RUN /opt/jboss/wildfly/bin/add-user.sh admin Admin#70365 --silent
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
Then you can build the image:
docker build --tag=hermanolira/wildfly-openj9-admin .
Run it:
docker run -it hermanolira/wildfly-openj9-admin
Administration console will be available on the port 9990 of the container.
You don't need to do this on your own, because we prepared a trusted build for this repository, but if you really want:
docker build --rm=true --tag=hermanolira/wildfly-openj9 .
This image extends the adoptopenjdk/openjdk8-openj9:latest image which adds the OpenJDK distribution on top of the ubuntu:16.04 image. Please refer to the README.md for selected images for more info.
The server is run as the jboss user which has the uid/gid set to 1000.
WildFly is installed in the /opt/jboss/wildfly directory.
The source is available on GitHub.
Content type
Image
Digest
Size
385.5 MB
Last updated
over 8 years ago
docker pull hermanolira/wildfly-openj9