Open topic with navigation

TIBCO ActiveMatrix® Service Grid - Container Edition 1.0.0

# Creating ActiveMatrix Service Grid - Container Edition Builder Image Using S2I Tool

OpenShift S2I is a tool for building reproducible Docker images. By using the S2I tool, you can create a builder image, which contains an operating system, all required libraries, and <TIBCO_HOME> with all the required scripts. You can reuse this builder image to create a new application Docker image. S2I supports reusing of previously downloaded dependencies and previously built artifacts. You need not build all dependencies each time you build an application Docker image.

Before you begin

- See Preparing for Containerization.
- Download and install latest binary of S2I from https://github.com/openshift/source-to-image/releases/. After installation, ensure to add the location of the S2I binary to your PATH environment variable.
- For default JVM arguments and Log4j configuration, see Default JVM Arguments and Logging Configuration for Application Image and Builder Image.
- To deploy custom features such as database drivers to all application Docker images, see Adding Custom Features to Builder Image.

Procedure
1. Navigate to amsgce-runtime-<version>/runtime/build/s2i.
2. Create Builder image by using the following script. You must create the builder image only once for the ActiveMatrix Service Grid - Container Edition release.

       ./build_amxce_s2i.sh -i <Builder Image Name>

   Example:

       ./build_amxce_s2i.sh -i amxce_builderimage

The following table lists the arguments to pass when building Builder Docker image.

Argument | Optional / Required | Description
--- | --- | ---
`-i / --image_tag <Image name>` | Required | Image tag for the Docker image. Image name must not contain space.
`-java <Java package file location>` | Optional | Location of Java Package to be used to create the image. This option can be used to provide pre-downloaded JDK or JRE to be used while creating the image. Image creation script skips downloading Java from a remote site when this option is provided. Specified Java package is copied automatically to `amsgce-runtime-<version>/runtime/java`. Previously specified package is removed from `amsgce-runtime-<version>/runtime/java` before copying the new package. Note: Do not manually copy the package directly to `amsgce-runtime-<version>/runtime/java`. Note: Do not specify the folder location. This must be the compressed Java package file location. Example: `dockerfile=Dockerfile_ubuntu_java11 ./build_amxce_s2i.sh -i bookstore:1.0 -java /Users/Downloads/openjdk-11+28_linux-x64_bin.tar12.gz`
-cf | --custom_feature | Optional | To add a custom feature such as database drivers to all application images of S2I build, add custom feature to the builder image. Then this custom feature is installed on all application images created by using the builder image. Specify the folder containing custom feature or custom feature DAA file. If folder location is passed as an argument then all custom features in that folder are copied. Example: `./build_amxce_s2i.sh --image_tag "bookstore:1.0" --custom_feature "/path/to/Custom Feature folder"`
dockerfile <Dockerfile Name> | Optional | Specify Dockerfile name to use a Dockerfile other than the default one. Example: `dockerfile=Dockerfile_ubi8_java11 ./build_amxce_s2i.sh --image_tag "bookstore:1.0"`
`-h / --help` | Optional | Displays help for the script file.

What to do nextYou can create an application Docker image based on builder image. For more information, see Creating Application Docker Image from Builder Image by Using S2I Tool.

Copyright © 2020-2021. TIBCO Software Inc. All Rights Reserved.