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. These 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
fullimage types. The beta images are available only for the latest beta release. For more information, see the Supported container image tags section.
- 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.
The latest Open Liberty release is available by using the following container image tags.
If you specify any image tag without including a version number, the latest version of Open Liberty is included in the container image that you pull. In addition to the latest version,
kernel-slim images for the two most recent quarterly releases are always available in ICR and are refreshed regularly.
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.168 releases 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
full image tags in the previous list. For example, if
22.214.171.124 is a recent quarterly release, you can pull an image that includes the
126.96.36.199 release with an OpenJ9 distribution of Java 8 by specifying the
188.8.131.52-full-java8-openj9-ubi tag. The
beta-instanton images are available only for the latest beta release.
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 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.
You can choose from two container image sets. The first uses the Red Hat Universal Base Image as the operating system. It is available from ICR and Docker Hub. The second uses Ubuntu as the operating system. It is available on Docker Hub and is rebuilt automatically whenever a change is made.
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.