Building the Application Docker Image by Using Docker Build

Scripts and Dockerfiles are provided in the deployment package to build a Docker image for the ActiveMatrix Service Grid - Container Edition application.

Before you begin
    Procedure
  1. Navigate to <temp_directory>/amsgce-runtime-<version>/runtime/build.
  2. To build TIBCO ActiveMatrix Application Docker image, run the following command. Specify the location of the folder or the .zip file that contains configuration YAML file, DAA, and optionally the Log4j and JVM configuration files by using --app_location argument.

    Syntax:

    ./build_amxce.sh --app_location <Application Configuration folder location> -i <Image name>  -n <Node name> -e <Environment name> -l <Image Build log level>

    Example:

    ./build_amxce.sh --image_tag "bookstore:1.0" --app_location /home/tibco/bookstore

The following table lists the arguments that you can pass when building an application Docker image.

Argument

Optional /

Required

Description
-i / --image_tag <Image name> Required

Image tag for the Docker image. <Image name> must be in the form of "Image name (Repository):tag or version" such as bookstore:1.0.

Image name must not contain space.

-n / --amxce_node <Nodename>

Optional

 

ActiveMatrix Service Grid - Container Edition node name in the container.

Default: AMXCENode

Node name must start with an alphabet character. It can have only alphanumeric, underscore (_), and hyphen (-) characters.

If the node name is specified when running the command, it overrides the node name specified in the YAML file.

If the node name is not specified as a command argument, node name specified in the YAML file is used.

If node name is not specified as a command argument or in YAML file, default node name is used.

-e / --amxce_env <Environment name>

Optional

ActiveMatrix Service Grid - Container Edition Environment name in a container.

Default: AMXCEEnvironment

If the environment name is specified when running the command, it overrides the environment name specified in the YAML file.

If the environment name is not specified as a command argument, environment name specified in the YAML file is used.

If environment name is not specified as a command argument or in YAML file, default environment name is used.

-l / --log_level <Image Build Log level> Optional

Set log_level to 1 for detailed output.

Helpful in debugging build failures.

Default: 0

-java <Java package file location> Optional

Specify the location of the 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 automatically copied to the amsgce-runtime-<version>/runtime/java folder. 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.sh -i test:1.0 -java /Users/Downloads/openjdk-11+28_linux-x64_bin.tar12.gz -app /Users/amxce/demo/sample_app

-app | --app_location <Application folder location> Required
Location of the application folder or the .zip file that contains configuration YAML file, DAA, and optionally the Log4j and JVM configuration files.
Note: Ensure that the application file or folder location is not in the amsgce-runtime-<version>/runtime folder. Image creation fails if the application location is in the runtime folder.

Supported folder structure of the Application .zip file or the Application Folder:

  • Application zip downloaded from Application Configurator can be used which follows the following structure inside the zip. It contains one or more custom features DAA, one application DAA, and one application configuration YAML directly under the root and the certs folder which contains the Keystores used by the application.
  • Application .zip extracted by Application Extractor can not be used for the -app argument. You will have to find the target application folder from extracted .zip file and zip the files with the same file structure that Application Configurator creates in the downloaded .zip file.

  • Application folder or .zip must contain one DAA (optionally the Custom Feature DAA for JDBC Drivers), one yaml configuration file, the "certs" folder which contains the Keystore files. If you have multiple yaml configuration files, image creation will fail.

    Note: Application configuration file with the .yml extension is not supported when creating an application Docker image. You must use application configuration file with the .yaml extension.

Example:

./build_amxce.sh -i bookstore:1.0 -app /Users/amxce/demo/sample_app.zip
./build_amxce.sh -i bookstore:1.0 -app /Users/amxce/demo/sample_app
dockerfile <Dockerfile Name> Optional

Specify Dockerfile name to use a Dockerfile other than the default one. Default Dockerfile is Dockerfile_alpine_java11.

Example:

dockerfile=Dockerfile_ubi8_java11 ./build_amxce.sh --image_tag "bookstore:1.0" -app /Users/amxce/demo/sample_app

-h / --help Optional Displays help for the script file.

Checking Image Build Logs

You can view the logs at amsgce-runtime-<version>/runtime/build/logs. The name of the log file is amxcebuild-<timestamp>.log.