Creating a Container Image with External Java
This procedure describes how to create a Docker container image that contains your own Java instead of the default BMC-provided image that already contains Java version 17 (OpenJDK).
You need to create your image from another BMC-provided image that does not contain Java. This image has the 9.21.200-k8s tag and is stored in the controlm/agent repository in the Docker Hub.
BMC-provided images are based on AlmaLinux Minimal, which includes a microdnf package manager.
Before You Begin
Ensure that the Linux x86_64 Java package is version 11 or 17 and that the vendor is supported, as listed in Control-M Compatibility with External Java Vendors.
BMC recommends that you use a headless variant of Java, whenever available, to reduce the image footprint and save space.
Begin
Create a Dockerfile with the following content:
FROM controlm/agent:9.21.200-k8s
ENV BMC_INST_JAVA_HOME=<path to your installed JDK>
RUN <JDK installation commands>
RUN ./update_java_home.shBuild an image based on the Dockerfile that you created by running the following command:
docker build . --tag <image name>
The image name includes the name of the repository where you want to upload the created image.Push the image to your private repository by running the following command:
docker push <image name>
The image name includes the name of the repository where you want to upload the image.