TIBCO BusinessEvents (BE) version 5.6.1 - build_app_image.bat failed when using cloud scripts and tooling cloned from github source

TIBCO BusinessEvents (BE) version 5.6.1 - build_app_image.bat failed when using cloud scripts and tooling cloned from github source

book

Article ID: KB0074823

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.6.1

Description

In BE version 5.6.1 scripts to build docker images are moved to Github from local file system.
See:
https://docs.tibco.com/pub/businessevents-enterprise/5.6.1/doc/html/GUID-6363E425-C15D-4FB7-BE41-5BC83A1B9971.html

GitHub link:
https://github.com/TIBCOSoftware/be-tools

When you clone the repository on a windows machine and executed script to create an image it failed (build_app_image.bat) with error as indicated below.

error: 
build_app_image.bat -a <app-location> -r <image-version> -d Dockerfile -l <location-installer-files>

Output:
----------------------------------------------
INFO: Installers Location - <directory>
INFO: Installers Platform - linux
INGO: BusinessEvents version - 5.6.1

...

Step 34/66 : RUN perl -I. -Mbe_docker_install -e "be_docker_install::replaceRunbeVersionToken('$BE_PRODUCT_VERSION','./run')"
 ---> Running in a83401dd2a9c
Removing intermediate container a83401dd2a9c
 ---> 97e24b1c89cd
Step 35/66 : RUN perl -I. -Mbe_docker_install -e "be_docker_install::generateAnnotationIndexes('/opt/tibco/be/${BE_SHORT_VERSION}', '/opt/tibco/tibcojre64/${JRE_VERSION}')"  && rm -rf as_installers be_installers *.zip  && find . -regex "./Dockerfile.*" ! -name '$DOCKERFILE_NAME' -delete
 ---> Running in 2d727c43b374

Building annotation indexes..WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javassist.util.proxy.SecurityActions (file:/opt/tibco/be/5.6/lib/ext/tpcl/javassist.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of javassist.util.proxy.SecurityActions
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Removing intermediate container 2d727c43b374
 ---> 95aa7e9c0948
Step 36/66 : WORKDIR /opt/tibco/be/$BE_SHORT_VERSION/bin/
 ---> Running in dab4e297d58f
Removing intermediate container dab4e297d58f
 ---> a173e6337909
Step 37/66 : RUN echo "java.property.be.engine.cluster.as.discover.url=%AS_DISCOVER_URL%" >> be-engine.tra   && echo "java.property.be.engine.cluster.as.listen.url=%AS_LISTEN_URL%" >> be-engine.tra  && echo "java.property.be.engine.cluster.as.remote.listen.url=%AS_REMOTE_LISTEN_URL%" >> be-engine.tra  && echo "java.property.com.sun.management.jmxremote.rmi.port=%jmx_port%" >> be-engine.tra
 ---> Running in f8c49df53e3d
Removing intermediate container f8c49df53e3d
 ---> 566a6dd09222
Step 38/66 : RUN chmod +x /home/tibco/be/gvproviders/*.sh && /home/tibco/be/gvproviders/setup.sh ${GVPROVIDERS}
 ---> Running in cd37b8b91f8d
/bin/sh: 1: /home/tibco/be/gvproviders/setup.sh: not found
The command '/bin/sh -c chmod +x /home/tibco/be/gvproviders/*.sh && /home/tibco/be/gvproviders/setup.sh ${GVPROVIDERS}' returned a non-zero code: 127
"Docker build failed."

Issue/Introduction

TIBCO BusinessEvents (BE) version 5.6.1 - build_app_image.bat failed when using cloud scripts and tooling cloned from github source

Environment

Windows (Build Docker images)

Resolution

The issue is caused by the github client used to clone the repository. The github client converts linefeeds to windows format for the Linux scripts, so that they cannot be executed in Linux environment.

To avoid/fix the issue:
1.) Update the git client settings before clone repository.

git config --global core.autocrlf input

See:
https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings

or 

2.) Clone repository from browser and load the files as a zip file

Note:
The warnings related to javassist.jar are harmless and you can ignore them.

Additional Information

Docker, build_app_image.bat