Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
working-directory: finish
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
distribution: 'semeru'
java-version: 11
java-version: 25
- run: unset _JAVA_OPTIONS
- name: Run tests
run: |
Expand Down
16 changes: 8 additions & 8 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2019, 2025 IBM Corporation and others.
// Copyright (c) 2019, 2026 IBM Corporation and others.
// Licensed under Creative Commons Attribution-NoDerivatives
// 4.0 International (CC BY-ND 4.0)
// https://creativecommons.org/licenses/by-nd/4.0/
Expand Down Expand Up @@ -256,9 +256,9 @@ Learn more about Docker on the https://www.docker.com/what-docker[official Docke
=== Creating your Dockerfiles
You will be creating two Docker images to run the `inventory` service and `system` service. The first step is to create Dockerfiles for both services.

In this guide, you're using an official image from the IBM Container Registry (ICR), `icr.io/appcafe/open-liberty:full-java11-openj9-ubi`, as your parent image. This image is tagged with the word `full`, meaning it includes all Liberty features. `full` images are recommended for development only because they significantly expand the image size with features that are not required by the application.
In this guide, you're using an official image from the IBM Container Registry (ICR), `icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal`, as your parent image. This image is tagged with the word `full`, meaning it includes all Liberty features. `full` images are recommended for development only because they significantly expand the image size with features that are not required by the application.

To minimize your image footprint in production, you can use one of the `kernel-slim` images, such as `icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi`. This image installs the basic Liberty runtime. You can then add all the necessary features for your application with the usage pattern that is detailed in the Open Liberty https://openliberty.io/docs/latest/container-images.html#build[container image documentation^]. To use the default image that comes with the Open Liberty runtime, define the `FROM` instruction as `FROM icr.io/appcafe/open-liberty`. You can find all official images on the Open Liberty https://openliberty.io/docs/latest/container-images.html[container image repository^].
To minimize your image footprint in production, you can use one of the `kernel-slim` images, such as `icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal`. This image installs the basic Liberty runtime. You can then add all the necessary features for your application with the usage pattern that is detailed in the Open Liberty https://openliberty.io/docs/latest/container-images.html#build[container image documentation^]. To use the default image that comes with the Open Liberty runtime, define the `FROM` instruction as `FROM icr.io/appcafe/open-liberty`. You can find all official images on the Open Liberty https://openliberty.io/docs/latest/container-images.html[container image repository^].

[role="code_command hotspot file=0", subs="quotes"]
----
Expand All @@ -278,7 +278,7 @@ It is also recommended to label your Docker images with the [hotspot=label file=

The [hotspot=copy-config hotspot=copy-war file=0]`COPY` instructions are structured as `COPY` [hotspot=config-userID hotspot=war-userID file=0]`[--chown=<user>:<group>]` [hotspot=inventory-config hotspot=inventory-war file=0]`<source>` [hotspot=config hotspot=config-apps file=0]`<destination>`. They copy local files into the specified destination within your Docker image. In this case, the `inventory` Liberty configuration files that are located at `src/main/liberty/config` are copied to the [hotspot=config file=0]`/config/` destination directory. The `inventory` application WAR file [hotspot=inventory-war file=0]`inventory.war`, which was created from running Maven `package` goal, is copied to the [hotspot=config-apps file=0]`/config/apps` destination directory.

The [hotspot=copy-config hotspot=copy-war file=0]`COPY` instructions use the [hotspot=config-userID hotspot=war-userID file=0]`1001` user ID and [hotspot=config-userID hotspot=war-userID file=0]`0` group because the `icr.io/appcafe/open-liberty:full-java11-openj9-ubi` image runs by default with the `USER 1001` (non-root) user for security purposes. Otherwise, the files and directories that are copied over are owned by the root user.
The [hotspot=copy-config hotspot=copy-war file=0]`COPY` instructions use the [hotspot=config-userID hotspot=war-userID file=0]`1001` user ID and [hotspot=config-userID hotspot=war-userID file=0]`0` group because the `icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal` image runs by default with the `USER 1001` (non-root) user for security purposes. Otherwise, the files and directories that are copied over are owned by the root user.

Place the [hotspot=configure-sh file=0]`RUN configure.sh` command at the end to get a pre-warmed Docker image. It improves the startup time of running your Docker container.

Expand Down Expand Up @@ -494,7 +494,7 @@ inventory/Dockerfile
include::finish/inventory/Dockerfile[]
----

Replace the parent image with [hotspot=kernel-slim file=0]`icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi` at the top of your `Dockerfile`. This image contains the `kernel-slim` tag that is recommended when deploying to production.
Replace the parent image with [hotspot=kernel-slim file=0]`icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal` at the top of your `Dockerfile`. This image contains the `kernel-slim` tag that is recommended when deploying to production.

Place [hotspot=features file=0]`RUN features.sh` command after the `COPY` command that copies the local `/config/` directory into the `Docker` image. The `features.sh` script adds the Liberty features that your application is required to operate.

Expand Down Expand Up @@ -560,12 +560,12 @@ docker exec -it inventory /opt/ol/wlp/bin/productInfo featureInfo
Your list of Liberty features should be similar to the following:
----
jndi-1.0
cdi-4.0
cdi-4.1
jsonb-3.0
jsonp-2.1
mpConfig-3.1
restfulWS-3.1
restfulWSClient-3.1
restfulWS-4.0
restfulWSClient-4.0
----

// static guide instructions:
Expand Down
2 changes: 1 addition & 1 deletion finish/inventory/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tag::kernel-slim[]
FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi
FROM icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal
# end::kernel-slim[]

ARG VERSION=1.0
Expand Down
2 changes: 1 addition & 1 deletion finish/inventory/Dockerfile-full
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tag::from[]
FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi
FROM icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal
# end::from[]

ARG VERSION=1.0
Expand Down
14 changes: 7 additions & 7 deletions finish/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<!-- Default test properties -->
<system.ip>localhost</system.ip>
<system.http.port>9080</system.http.port>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>10.0.0</version>
<version>11.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -78,24 +78,24 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</plugin>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.11.5</version>
<version>3.12.5</version>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
<configuration>
<systemPropertyVariables>
<system.ip>${system.ip}</system.ip>
Expand Down
2 changes: 1 addition & 1 deletion finish/inventory/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<server description="Sample Liberty server">

<featureManager>
<platform>jakartaee-10.0</platform>
<platform>jakartaee-11.0</platform>
<platform>microprofile-7.1</platform>
<feature>restfulWS</feature>
<feature>jsonb</feature>
Expand Down
6 changes: 3 additions & 3 deletions finish/inventory/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Liberty Project</display-name>

<welcome-file-list>
Expand Down
3 changes: 3 additions & 0 deletions finish/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
<module>system</module>
<module>inventory</module>
</modules>
<properties>
<maven.compiler.release>25</maven.compiler.release>
</properties>

</project>
2 changes: 1 addition & 1 deletion finish/system/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tag::kernel-slim[]
FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi
FROM icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal
# end::kernel-slim[]

ARG VERSION=1.0
Expand Down
2 changes: 1 addition & 1 deletion finish/system/Dockerfile-full
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi
FROM icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal

ARG VERSION=1.0
ARG REVISION=SNAPSHOT
Expand Down
14 changes: 7 additions & 7 deletions finish/system/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<!-- Liberty configuration -->
<liberty.var.http.port>9080</liberty.var.http.port>
<liberty.var.https.port>9443</liberty.var.https.port>
Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>10.0.0</version>
<version>11.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -63,25 +63,25 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</plugin>
<!-- Enable Liberty Maven plugin -->
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.11.5</version>
<version>3.12.5</version>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
<configuration>
<systemPropertyVariables>
<system.http.port>${liberty.var.http.port}</system.http.port>
Expand Down
2 changes: 1 addition & 1 deletion finish/system/src/main/liberty/config/server.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<server description="Sample Liberty server">

<featureManager>
<platform>jakartaee-10.0</platform>
<platform>jakartaee-11.0</platform>
<feature>restfulWS</feature>
<feature>jsonb</feature>
<feature>jsonp</feature>
Expand Down
6 changes: 3 additions & 3 deletions finish/system/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Liberty Project</display-name>

<welcome-file-list>
Expand Down
2 changes: 1 addition & 1 deletion scripts/dailyBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sed -i "\#<artifactId>liberty-maven-plugin</artifactId>#a<configuration><install
cat ../start/system/pom.xml ../start/inventory/pom.xml ../finish/system/pom.xml ../finish/inventory/pom.xml

if [[ "$DOCKER_USERNAME" != "" ]]; then
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM $DOCKER_USERNAME/olguides:$BUILD;g" system/Dockerfile inventory/Dockerfile
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal;FROM $DOCKER_USERNAME/olguides:$BUILD;g" system/Dockerfile inventory/Dockerfile
sed -i "s;RUN features.sh;;g" system/Dockerfile inventory/Dockerfile
cat system/Dockerfile inventory/Dockerfile
fi
Expand Down
16 changes: 8 additions & 8 deletions scripts/dockerImageTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ sed -i "\#<artifactId>liberty-maven-plugin</artifactId>#a<configuration><install
cat ../start/system/pom.xml ../start/inventory/pom.xml ../finish/system/pom.xml ../finish/inventory/pom.xml

if [[ "$OL_LEVEL" != "" ]]; then
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi;g" system/Dockerfile inventory/Dockerfile
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java25-openj9-ubi-minimal;g" system/Dockerfile inventory/Dockerfile
else
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile inventory/Dockerfile
sed -i "s;FROM icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java25-openj9-ubi-minimal;g" system/Dockerfile inventory/Dockerfile
fi
sed -i "s;RUN features.sh;#RUN features.sh;g" system/Dockerfile inventory/Dockerfile
cat system/Dockerfile inventory/Dockerfile
if [[ "$OL_LEVEL" != "" ]]; then
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi;g" system/Dockerfile-full inventory/Dockerfile-full
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal;FROM cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java25-openj9-ubi-minimal;g" system/Dockerfile-full inventory/Dockerfile-full
else
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java11-openj9-ubi;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi;g" system/Dockerfile-full inventory/Dockerfile-full
sed -i "s;FROM icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal;FROM cp.stg.icr.io/cp/olc/open-liberty-daily:full-java25-openj9-ubi-minimal;g" system/Dockerfile-full inventory/Dockerfile-full
fi
cat system/Dockerfile-full inventory/Dockerfile-full

echo "$DOCKER_PASSWORD" | sudo docker login -u "$DOCKER_USERNAME" --password-stdin cp.stg.icr.io
if [[ "$OL_LEVEL" != "" ]]; then
sudo docker pull -q "cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi"
sudo echo "build level:"; docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" "cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java11-openj9-ubi"
sudo docker pull -q "cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java25-openj9-ubi-minimal"
sudo echo "build level:"; docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" "cp.stg.icr.io/cp/olc/open-liberty-vnext:$OL_LEVEL-full-java25-openj9-ubi-minimal"
else
sudo docker pull -q "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi"
sudo echo "build level:"; docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java11-openj9-ubi"
sudo docker pull -q "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java25-openj9-ubi-minimal"
sudo echo "build level:"; docker inspect --format "{{ index .Config.Labels \"org.opencontainers.image.revision\"}}" "cp.stg.icr.io/cp/olc/open-liberty-daily:full-java25-openj9-ubi-minimal"
fi

sudo ../scripts/testAppFinish.sh
Expand Down
4 changes: 2 additions & 2 deletions scripts/testAppFinish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ cd ../finish
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \
-q clean package

docker pull -q icr.io/appcafe/open-liberty:full-java11-openj9-ubi
docker pull -q icr.io/appcafe/open-liberty:kernel-slim-java11-openj9-ubi
docker pull -q icr.io/appcafe/open-liberty:full-java25-openj9-ubi-minimal
docker pull -q icr.io/appcafe/open-liberty:kernel-slim-java25-openj9-ubi-minimal

docker build -t system -f ./system/Dockerfile-full system/.
docker build -t inventory -f ./inventory/Dockerfile-full inventory/.
Expand Down
16 changes: 8 additions & 8 deletions start/inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<!-- Default test properties -->
<system.ip>localhost</system.ip>
<system.http.port>9080</system.http.port>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>10.0.0</version>
<version>11.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -78,24 +78,24 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</plugin>
<plugin>
<groupId>io.openliberty.tools</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>3.11.5</version>
<version>3.12.5</version>
</plugin>
<!-- Plugin to run unit tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
</plugin>
<!-- Plugin to run functional tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.6</version>
<configuration>
<systemPropertyVariables>
<system.ip>${system.ip}</system.ip>
Expand All @@ -106,4 +106,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Loading
Loading