This project can be built with Apache Maven. The project uses [Liberty Maven Plug-in][] to automatically download and install Liberty from the Liberty repository. Liberty Maven Plug-in is also used to create, configure, and run the application on the Liberty server.
Use the following steps to run the application locally:
-
Execute full Maven build to create the
target/JavaHelloWorldApp.war
file:$ mvn clean install
-
Download and install Liberty, then use it to run the built application from step 1:
$ mvn liberty:run-server
Once the server is running, the application will be available under http://localhost:9080/JavaHelloWorldApp.
Use the following command to run the built application in Bluemix:
bash $ cf push <appname> -p target/JavaHelloWorldApp.war
docker pull websphere-liberty
docker run -d -p 80:9080 --name=app -v $PWD/target/JavaHelloWorldApp.war:/config/dropins/app.war websphere-liberty
Dockerfile
FROM websphere-liberty:latest
USER root
COPY --chown=1001:0 ./target/JavaHelloWorldApp.war /config/dropins/app.war
EXPOSE 9080
USER 1001
Build Dockerfile
docker build -t app .
Run docker image
docker run -d -p 80:9080 --name=app app