Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (30 sloc) 1.44 KB

Demo: Java Image

This project uses for 'articles' and 'web-api' a Java image with only open source components:

  • OpenJ9 0.12.1
  • OpenJDK 8u202-b08 from AdoptOpenJDK
  • Open Liberty
  • MicroProfile 2.1

Additionally zipkintracer is copied onto the image to support distributed tracing.

This is the used Dockerfile which uses multiple stages so that the image can be built on environments that don't have Java and Maven (or wrong versions) installed.

FROM maven:3.5-jdk-8 as BUILD
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package

FROM openliberty/open-liberty:microProfile2-java8-openj9
RUN unzip -d /opt/ol/wlp/usr/ \
 && rm
COPY liberty/server.xml /config/
COPY --from=BUILD /usr/src/app/target/articles.war /config/dropins/

Invoke the following commands to set up the Java based microservice 'articles':

$ scripts/
$ scripts/
$ scripts/
$ scripts/

Invoke the curl command which is displayed as output of 'scripts/' to get ten articles.

Check out the article Dockerizing Java MicroProfile Applications for more details.

You can’t perform that action at this time.