Deploying a Flogo App using Custom Application Image

You can build Flogo applications outside TIBCO Platform by using TIBCO Flogo® - App Build Command Line Interface. You can deploy these applications to TIBCO Platform using your own custom application image with all dependencies preinstalled. This approach provides the capability to:

  • Deploy applications directly to TIBCO Platform without requiring Internet access to Flogo provisioner.

  • Eliminate the need to provisioning Flogo Connectors and supplements separately in your Data Plane.

  • Create lightweight application images based on Alpine or Debian, instead of using the default Amazon Linux image.

    Procedure
  1. Build a Docker image for your application with all required dependencies.

    The following are the sample start.sh and Dockerfile:

    • start.sh

      Copy
      #!/usr/bin/env bash
      mkdir -p /app/logs/${HOSTNAME}/flogoapp
      export FLOGO_FILES_ROOT_DIR="${FLOGO_FILES_ROOT_DIR:-/tmp/flogo}"
      ./flogo-app 2>&1 | tee >(rotatelogs -t /app/logs/${HOSTNAME}/flogoapp/otel.log 10M)
    • Sample Dockerfile

      Copy
      FROM alpine:3.19
      LABEL maintainer="Cloud Software Group, Inc."

      # Set language and locale related variables
      # Set LD_LIBRARY_PATH for native libraries
      # Update PATH to include required directories
      ENV LANG=C.UTF-8 \
          LC_ALL=C.UTF-8 \
          LD_LIBRARY_PATH=/opt/oracle/instantclient_21_13 \
          PATH=/opt/oracle/instantclient_21_13:$PATH


      # Install dependencies:
      # - apache2-utils: required by rotatelogs command in the buildpack script
      # - bash: required for running shell scripts
      # - ca-certificates: for SSL/TLS support
      # - curl: to download Oracle Instant Client
      # - gcompat: provides compatibility for glibc applications on Alpine
      # - libaio, libnsl: required for Oracle
      # - libstdc++: required for C++ applications, including Oracle Instant Client
      # - libpq: required for PostgreSQL
      # - shadow: to run groupadd and useradd commands
      # - unixodbc, unixodbc-dev: required for TDV
      # - unzip: to extract supplement zip files
      RUN apk add --no-cache apache2-utils bash ca-certificates curl gcompat libaio libnsl libstdc++ shadow unzip && \
          mkdir -p /opt/oracle /home/flogo /app/logs /usr/tp/flogo && \
          groupadd -g 1000 flogo && \
          useradd -u 1000 -g 1000 -s /bin/sh -M flogo

      # Download and extract Oracle Instant Client    
      WORKDIR /opt/oracle
      RUN curl -O https://download.oracle.com/otn_software/linux/instantclient/2113000/instantclient-basic-linux.x64-21.13.0.0.0dbru.zip && \
          unzip instantclient-basic-linux.x64-21.13.0.0.0dbru.zip && \
          rm instantclient-basic-linux.x64-21.13.0.0.0dbru.zip

      # Set working directory and copy application files
      WORKDIR /usr/tp/flogo
      COPY start.sh flogo-app ./

      # Set permissions and ownership
      RUN chown -R flogo:flogo /opt/oracle /home/flogo /app/logs /usr/tp/flogo && \
          chmod +x start.sh flogo-app

      # Run as non-root user
      USER flogo

      # Start the application
      ENTRYPOINT ["./start.sh"]
  2. Push the application image to your registry, such as Docker Hub or a private registry.

  3. Obtain the fully qualified image name from your image registry. For example: us-central1-docker.pkg.dev/my-username/flogo-app:v1.0.1

  4. Create a context by specifying the appropriate flags using TIBCO Flogo® - App Build Command Line Interface and TIBCO Flogo® Extension for Visual Studio Code version 1.3.2 or higher. For more information on how to install and use TIBCO Flogo - App Build CLI, see Installing TIBCO Flogo - App Build CLI.

    Example:

    flogobuild create-context -n "<context-name>" -v "<path-to-.vsix file>" --set-default
  5. After creating the context, create the TIBCO Platform deployment zip file for your Flogo application using Flogo® - App Build Command Line Interface (CLI).

    Example:

    flogobuild build-tp-deployment -f "<path-to-flogo-app-file>" -i "<fully-qualified-custom-container-image-name>" -c "<context-name>" -t "<tag1, tag2>" -o "<path-for-zip-file>" -z "<zip-file-name>"
    Note: The -t and -z flags are optional. If you want to use the default context, you do not need to specify the -c flag. For more information about the build-tp-deployment command, see Building Flogo App Executable and Docker Image Using Flogo - App Build CLI.
  6. Import the generated build.zip file to TIBCO Platform. For more information, see App Builds.

  7. Deploy your custom app image build using either the Flogo provisioner or Helm chart. For more information, see Deploying a Flogo App using Flogo Provisioner or Deploying a Flogo App using Helm Charts.

Note:
  • If you use a private image repository, specify the repository password in the imagePullSecret field of the values.yaml file to enable image pulling in the container.

  • To view the custom image tag or application metadata, go to the hamburger menu on the App Details Page and click App Information. You can also view the custom image tag in the YAML editor under the Helm Configuration tab of the application.

  • You cannot upgrade applications deployed with a custom Docker image using the TIBCO Platform Web UI.