Building Flogo App Executable and Docker Image Using Flogo - App Build CLI

TIBCO Flogo® - App Build Command Line Interface is a command-line utility for building Flogo applications, especially in CI/CD pipelines. It provides a consistent and easy-to-use interface for building and testing Flogo applications.

Note: All the app executables created from the Linux build of Flogo - App Build CLI are production binaries and require a valid license file to run.

Flogo® - App Build Command Line Interface (CLI) Usage

  • Build Flogo application executables (.exe) on Windows, Linux, or Darwin platforms.

  • Test Flogo applications using Flogo app files (.flogo or .json), Flogo app executables, and .flogotest files.

  • Build Docker images for your Flogo applications.

  • Package Flogo executables into Docker images.

  • Build TIBCO Control Plane deployment ZIP files for your Flogo applications.

Note: Cross-compilation is not supported when building apps. For example, attempting to build a Linux target (OS: linux, Arch: amd64) from a Windows host will result in the following error:

"Cross-compilation is not supported for this OS (linux) and Arch (amd64) combination on Host Windows machine."

To build for a Linux target, you must run the Flogo - App Build CLI in a Linux environment (native host, container, or VM).

Flogo - App Build CLI Commands

flogobuild

Usage

flogobuild [COMMAND]

Commands

Command Description
build-docker-image Builds a Flogo application Docker image.
build-exe Builds a Flogo application executable.
build-tp-deployment Builds a TIBCO Control Plane deployment zip file for the Flogo application.
create-context Creates a context for building and packaging Flogo applications.
delete-context Deletes an existing context.
help Displays help about any command.
list-context Lists available contexts.
package-docker-image Packages an existing Linux-based Flogo application executable as a Docker image.
set-default-context Sets one of the configured contexts as the default for building and packaging Flogo applications.
test-app Runs unit test cases.
version Displays the version.

Global Flags

Flag Description
--debug Enables debug mode for detailed logging.
--verbose Enables verbose mode to display additional output.

create-context

Note: Before you begin using the Flogo - App Build CLI to build executables, create Docker images, or run unit tests, it is mandatory to create the context by specifying the appropriate flags in the command.

Usage

flogobuild create-context [flags]

Available Flags

Flags Description
-n, --context-name

This flag is required.

Specify the name of the context.

-e, --ems-home-directory Specify the path to the EMS home directory.
-h, --help Displays help for create-context.
-i, --ibmmq-home-directory Specify the path to the IBM MQ home directory.
--set-default Sets the new context as default.
-u, --user-extension-directory Specify the path to the user extension directory.
-v, --vsc-extension-file

This flag is required.

Specify the path to the Flogo VSCode extension VSIX file.

Note: By default, the context is created at /home/<user-name>/tibco/.fecli. To override this default directory, set the FLOGO_CLI_CTX_DIR environment variable and specify the desired destination directory for storing the context.

Example

flogobuild create-context --context-name "<context-name>" --vsc-extension-file "<path-to-vsc-file>\<.vsix file>" --user-extension-directory "<extension-directory>" --ems-home-directory "<ems-home-directory>" --ibmmq-home-directory "<ibmq-home-directory>"

build-docker-image

Usage

flogobuild build-docker-image [flags]

Available Flags

Flag Description
-f , --app-json-file

This flag is required.

Specify the path to the Flogo application file (.json/.flogo).

-c, --context-name Specify the name of the context to be used for building applications. If not provided, the default context is used.
-d, --docker-file Specify the path to the Flogo application Dockerfile.
-i, --docker-image-name

This flag is required.

Specify the Docker image name and tag, for example, flogotestapp:1.0.0.

-n, --exe-name Specify the name of the executable file. If not provided, the app name is used as the executable file name.
-h, --help Displays help for build-docker-image.
-o, --output-directory Specify the directory where the executable file is to be created. If not provided, the executable is created in the current directory.

Example

flogobuild build-docker-image -f "<path-to-flogo-app-file>" -i "<docker-img-name>" -c "<context-name>" -n "<executable-file-name>" -o "<path-for-exe-file>" -d "<path-for-dockerfile>"

build-exe

Usage

flogobuild build-exe [flags]

Available Flags

Flag Description
-f, --app-json-file

This flag is required.

Specify the path to the Flogo application file (.json/.flogo).

-c, --context-name Specify the name of the context to be used for building applications. If not provided, the default context is used.
-n, --exe-name Specify the name of the executable file. If not provided, the app name is used as the executable file name.
-h, --help Displays help for build-exe.
-l, --license-file string

Path for license file.

Note: This flag is supported only in the Linux build.

-o, --output-directory Specify the directory where the executable file is to be created. If not provided, the executable is created in the current directory.
-p, --platform Specify the platform type for the app executable. Specify a value in GOOS/GOARCH format. For example, ["linux/amd64", "windows/amd64", "darwin/amd64", "darwin/arm64"].

Example

flogobuild build-exe -f "<path-to-flogo-app-file>" -c "<context-name>" -n "<executable-file-name>" -o "<path-for-exe-file>"

build-tp-deployment

Note: If you choose not to upload the external supplement or provision the connector on TIBCO® Control Plane, you can still deploy and run the connector app by using a custom application image. Specify the fully qualified custom container image for the Flogo app in the build-tp-deployment command, then import the .zip file generated by that command into TIBCO Control Plane. For more information, see Deploying a Flogo App using Custom Application Image.

Usage

flogobuild build-tp-deployment [flags]

Available Flags

Flag Description
-f, --app-json-files

This flag is required.

Specify the path to the Flogo application file (.json/.flogo).

-i, --container-image-name Specify the name of the fully qualified custom container image for the flogo app.
-c, --context-name Specify the name of the context to be used for building applications. If not provided, the default context is used.
-h, --help Displays help for build-exe.
-l, --license-file string

Path for license file.

Note: This flag is supported only in the Linux build.

-o, --output-directory

This flag is required.

Specify the directory where the deployment zip is to be created.

-t, --tags Specify a comma-separated list of tags for the deployment.
-z, --zipfile-name Specify the name of the zip file to be created. If not provided, build.zip is used.

Example

flogobuild build-tp-deployment -f "<path-to-flogo-app-file>" -c "<context-name>" -o "<path-for-zip-file>" -t "<tag1, tag2>" -z "<zip-file-name>" -i "<fully-qualified-custom-container-image-name>"

delete-context

Usage

flogobuild delete-context [flags]

Available Flags

Flag Description
-c, --context-name

This flag is required.

Specify the name of the context to be deleted.

-h, --help Displays help for delete-context.

Example

flogobuild delete-context -c <context-name>

list-context

Example

flogobuild list-context

package-docker-image

Usage

flogobuild package-docker-image [flags]

Available Flags

Flag Description
-d, --docker-file Specify the path to the Flogo application Dockerfile.
-i, --docker-image-name

This flag is required.

Specify the Docker image name and tag.

-n, --exe-name

This flag is required.

Specify the path to the executable file.

-h, --help Displays help for package-docker-image.

Example

flogobuild package-docker-image --docker-image-name "<docker-image-name>" --exe-name "<path-to-exe-file>" -d "<path-to-dockerfile>"

set-default-context

Usage

flogobuild set-default-context [flags]

Available Flags

Flag Description
-c, --context-name

This flag is required.

Specify the name of the context to be set as default.

-h, --help Displays help for set-default-context.

Example

flogobuild set-default-context -c <Context-name>

test-app

Usage

flogobuild test-app [flags]

Available Flags

Flag Description
-e, --app-exe-file Specify the path to the executable file to be tested. This parameter is required if the --app-json-file flag is not provided.
-a, --app-json-file Specify the path to the Flogo application file (.json/.flogo). This parameter is required if the --app-exe-file flag is not provided.
-p, --app-props-file Specify the path to the application property file.
-c, --context-name Specify the name of the context to be used for building applications. If not provided, the default context is used.
-v, --env-vars-file Specify the path to the environment variable property file.
-h, --help Displays help for test-app.
-d, --output-directory Specify the path to the output directory.
-o, --output-file Specify the name of the output file.
-f, --test-file

This flag is required.

Specify the path to the test file.

-t, --test-suites Specify a comma-separated list of test suites to run.

Example

flogobuild test-app --app-exe-file "<path-to-exe-file>" --test-file "<path-to-test-files>" --context-name "<Context-name>" --output-directory "<path-to-output-dir>" --output-file "<output-file-name>" --test-suites "<Testsuite_1,Testsuite_2>" --app-props-file "<path-to-app-prop-file>/<prop-file>" --env-vars-file "<path-to-env-file>/<env-file>"

Generating Linux ARM-Based Build Executables from Linux AMD64

This topic describes how to perform cross-compilation to generate Linux ARM architecture executables for TIBCO Flogo® apps while working on a Linux AMD64 build environment.

Before you begin
  • Ensure your have the gcc compiler installed on your Linux AMD64 machine. You can install it using the following command:

    apt-get install gcc-aarch64-linux-gnu
  • Ensure your Flogo app does not contain the following connectors or supplements, as they are not supported for Linux ARM cross-compilation:

    • TIBCO Enterprise Message Service™ (EMS) (The EMS supplement is not available for ARM architecture).

    • TIBCO Data Virtualization (TDV) connector.

    • SAP Solution connector (The NWRFCSdk official supplement is not available for Linux ARM64).

    Procedure
  1. Open your command-line interface on the Linux AMD64 machine.

  2. Run the flogobuild command with the -p linux/arm64 option to specify the target platform. Use the following syntax:

    flogobuild build-exe -f "<path-to-flogo-app-file>" -c "<context-name>" -n "<executable-file-name>" -o "<path-for-exe-file>" -p linux/arm64
Note: If your app contains the Oracle Database connector, you must install the Linux ARM-compatible Oracle Instant Client libraries on your target Linux ARM machine to run the executable. For more information on how to install, see Oracle Instant Client Downloads for Linux ARM (aarch64).

Building Linux ARM64 Docker Images

This feature allows you to generate Linux ARM64 compatible Docker images directly from a Linux AMD64 build environment. This section describes how to cross-compile a Flogo application into a Linux ARM64 executable from a Linux AMD64 environment and package it into a compatible Docker image using the flogobuild tool and docker buildx.

Before you begin
  • You must have the flogobuild CLI tool and Docker installed and accessible in your environment.

  • Ensure your application does not contain the following components, as they are not supported for ARM64 cross-compilation:

    • TIBCO Enterprise Message Service™ (EMS)

    • TIBCO Data Virtualization (TDV) Connector

    • SAP Solution Connector (due to the unavailability of the NWRFC SDK supplement for Linux ARM64)

    Procedure
  1. Open your terminal and run the following command to cross-compile your application.

    Ensure you set -p linux/arm64 to target the ARM architecture.

    bash
         flogobuild build-exe -f "<path-to-flogo-app-file>" \
    			    -c "<context-name>" \
    			    -n "<executable-file-name>" \
    			    -o "<path-for-exe-file>" \
    			    -p linux/arm64

    where:

    • -f is the path to your Flogo application JSON file.

    • -c is the build context name.

    • -n is the desired name for the output executable.

    • -o is the output directory path.

    • -p is the target platform. It must be linux/arm64.

  2. Navigate to the directory where the executable was generated in the previous step.

  3. Create a new file named Dockerfile in this directory.

  4. Add the following sample configuration to the Dockerfile.

    This configuration uses a Debian-based Golang image, installs the necessary cross-compiler, and sets up the executable.

    Dockerfile

    # Use a specific version of Golang as the base image

    FROM golang:1.25.3-bookworm AS builder



    WORKDIR /build



    # Install the ARM64 GCC cross-compiler

    RUN apt-get update && apt-get install -y gcc-aarch64-linux-gnu



    # Copy the executable generated in Step 1 (Replace 'rest' with the actual executable name)

    COPY rest .



    # Ensure the binary is executable

    RUN chmod +x rest



    # Entry point configuration would go here (e.g., CMD ["./rest"])
  5. Build the final Docker image targeting the ARM64 platform by running the following command:

    bash

    docker buildx build --platform linux/arm64 -t <imageName>:<imageTag> .