Open Liberty container images
A container image is a layered executable software package that contains everything you need to build and run a containerized application. You can use an Open Liberty container image to build an application image that meets your development needs.
You can append an Open Liberty container image tag to the
icr.io/appcafe/open-liberty: source to specify the details of the container image that you pull from ICR. For more information, see the Build an application image section.
Select from the following container image tags for the latest Open Liberty release from ICR.
These tags pull the latest version because they do not specify a version number. You can specify a version other than the latest version in the image tag. For more information about these tag values, see the Container image tags naming conventions section.
If you have an IBM Cloud ID, you can generate a list of the currently available images in ICR by using the IBM Cloud CLI with the IBM Cloud Container Registry CLI plug-in installed. Authentication is required only to list the images. You can pull images from ICR without authentication. To list the images, run the following commands.
ibmcloud login ibmcloud cr region-set global ibmcloud cr images --restrict appcafe/open-liberty
You can use an Open Liberty container image tag in a
Containerfile file to build an application image that adds a single application and its corresponding configuration. Do not configure the container manually after it is started, except for debugging purposes, because these changes are not reflected in new containers that are created from the image.
Set your image template similar to the following example, which uses the
kernel-slim-java17-openj9-ubi tag to build an image that uses the latest Open Liberty release with the OpenJ9 distribution of Java 17.
FROM icr.io/appcafe/open-liberty:kernel-slim-java17-openj9-ubi # Add a Liberty server configuration including all necessary features COPY --chown=1001:0 server.xml /config/ # This script adds the requested XML snippets to enable Liberty features and grow the image to be fit-for-purpose. # This option is available only in the 'kernel-slim' image type. The 'full', 'beta' and 'beta-instanton' tags already include all features. RUN features.sh # Add interim fixes (optional) COPY --chown=1001:0 interim-fixes /opt/ol/fixes/ # Add an application COPY --chown=1001:0 Sample1.war /config/dropins/ # This script adds the requested server configuration, applies any interim fixes, and populates caches to optimize the runtime. RUN configure.sh
A template like this example results in a container image that has your application and configuration preinstalled, which means you can create new fully configured containers at any time. For more information about the different arguments and environment variables that you can specify to customize your application image, see the Open Liberty container image GitHub documentation.
Open Liberty container image tags use the following naming convention.
<optional fix pack version-><liberty image type>-<java version>-<java type>-ubi
The following tag values determine the resources that are included in a container image.
- Fix pack version
This value is optional. If you do not specify a fix pack version, your container image includes the latest release of Open Liberty. In addition to the latest release, the two most recent quarterly fix pack releases are always maintained for the
Open Liberty quarterly release versions end in
.12. For example, if the latest Open Liberty release is
220.127.116.11, then the
18.104.22.168releases are also maintained in ICR. To pull one of these release versions instead of the latest, add your chosen release version to the beginning of any of the
fullimage tags in the previous list. For example, if
22.214.171.124is a recent quarterly release, you can pull an image that includes the
126.96.36.199release with an OpenJ9 distribution of Java 8 by specifying the
beta-instantonimages are available only for the latest beta release.
- Liberty image type
Two different image types are available:
fulltype provides a server with all Open Liberty features and packages installed.
kernel-slimtype provides just the bare minimum server, which you can customize by adding only the features that your application needs. This image type supports the best practice for production images because you end up with a more lightweight image that packages only what is essential for your application. For more information, see the Build an application image section.
- Java version
This value determines the version of Java SE that the runtime uses. Tags are available for all Java long term support (LTS) releases that are listed on the Java SE Support page.
- Java type
This value determines the type of Java SE distribution that the runtime uses. Current options are IBM Semeru with Eclipse OpenJ9 and, for Java SE 8 only, the IBM SDK, Java Technology Edition.
In addition to the tags that follow this naming convention, Open Liberty offers three preformatted tags that pull particular images.
latest: This tag simplifies pulling the full latest Open Liberty release with Java 8. It is an alias for the
beta: This tag provides the most recent beta release, which includes all the features and capabilities from the most recent release, plus new and updated features that are currently in development.
beta-instanton: This tag is the same as the
betatag, except it also includes prerequisites for the Open Liberty InstantOn beta feature. Both the beta images are UBI 8-based images with IBM Semeru 17 for x86-64/amd64 architectures.