Facing issue in creating Docker Image of Mendix Application

0
ubuntu@ip-172-31-47-39:~/pcv/docker-mendix-buildpack-master$ sudo docker build --build-arg BUILD_PATH="./projects" -t aidd-pcv-dockerimage . Sending build context to Docker daemon  226.5MB Step 1/39 : ARG ROOTFS_IMAGE=mendix/rootfs:ubi8 Step 2/39 : ARG BUILDER_ROOTFS_IMAGE=mendix/rootfs:bionic Step 3/39 : FROM ${BUILDER_ROOTFS_IMAGE} AS builder  ---> cf95ed7ffb1b Step 4/39 : ARG BUILD_PATH=project  ---> Using cache  ---> 72a422d968bb Step 5/39 : ARG DD_API_KEY  ---> Using cache  ---> a62efa4bf5c1 Step 6/39 : ARG CF_BUILDPACK=v4.30.2  ---> Using cache  ---> 3a29c98720b1 Step 7/39 : ARG CF_BUILDPACK_URL=https://github.com/mendix/cf-mendix-buildpack/releases/download/${CF_BUILDPACK}/cf-mendix-buildpack.zip  ---> Using cache  ---> d75abbe0c36c Step 8/39 : ARG EXCLUDE_LOGFILTER=true  ---> Using cache  ---> 91d3dba7ff8b Step 9/39 : ARG BLOBSTORE  ---> Using cache  ---> 7d6d6f5f5009 Step 10/39 : ARG BUILDPACK_XTRACE  ---> Using cache  ---> 9aa5b500e856 Step 11/39 : ARG USER_UID=1001  ---> Using cache  ---> d66b90bc9116 Step 12/39 : RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build &&    ln -s /root /home/vcap &&    echo "Downloading CF Buildpack from ${CF_BUILDPACK_URL}" &&    curl -fsSL ${CF_BUILDPACK_URL} -o /tmp/cf-mendix-buildpack.zip &&     python3 -m zipfile -e /tmp/cf-mendix-buildpack.zip /opt/mendix/buildpack/ &&    rm /tmp/cf-mendix-buildpack.zip &&    chown -R ${USER_UID}:0 /opt/mendix &&    chmod -R g=u /opt/mendix  ---> Using cache  ---> ceca501235f6 Step 13/39 : COPY scripts/compilation scripts/git /opt/mendix/buildpack/  ---> Using cache  ---> 0624e06db0ff Step 14/39 : COPY $BUILD_PATH /opt/mendix/build  ---> Using cache  ---> bcca5f4e90e6 Step 15/39 : RUN chmod +rx /opt/mendix/buildpack/bin/bootstrap-python && /opt/mendix/buildpack/bin/bootstrap-python /opt/mendix/buildpack /tmp/buildcache  ---> Using cache  ---> 780f12f47102 Step 16/39 : ENV PYTHONPATH "$PYTHONPATH:/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.6/site-packages/"  ---> Using cache  ---> cad4a53351ef Step 17/39 : ENV NGINX_CUSTOM_BIN_PATH=/usr/sbin/nginx  ---> Using cache  ---> a90282df510b Step 18/39 : RUN mkdir -p /tmp/buildcache /tmp/cf-deps /var/mendix/build /var/mendix/build/.local &&    chmod +rx /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git /opt/mendix/buildpack/buildpack/stage.py &&    cd /opt/mendix/buildpack &&    ./compilation /opt/mendix/build /tmp/buildcache /tmp/cf-deps 0 &&    rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git &&    ln -s /opt/mendix/.java /opt/mendix/build &&    chown -R ${USER_UID}:0 /opt/mendix /var/mendix &&    chmod -R g=u /opt/mendix /var/mendix  ---> Running in 411636dcfc9d INFO: Mendix project compilation phase... INFO: Preflight check on Mendix version [9.14.1.46860] and stack [None]... INFO: Preflight check completed INFO: Building from source... INFO: Selecting Mono Runtime: 5    __  __      ____        _ _     _   |  \/  |    |  _ \      (_) |   | |   | \  / |_  _| |_) |_   _ _| | __| |   | |\/| \ \/ /  _ <| | | | | |/ _` |   | |  | |>  <| |_) | |_| | | | (_| |   |_|  |_/_/\_\____/ \__,_|_|_|\__,_|    v9.14.1.46860 Starting build for Mendix Project file: /opt/mendix/build/PCV.mpr Using the following options:  * Build target: Package  * Deployment package file: /tmp/model.mda Reading project file... Building project... Executing step 'Synchronize with file system'  * Synchronizing with file system... Executing step 'Initialize'  * Preparing deployment... Executing step 'Check prerequisites'  * Checking for errors... Executing step 'Clean deployment directory'  * Cleaning data broker files...  * Cleaning deployment directory...  * Cleaning web deployment directory...  * Cleaning source web deployment directory... Executing step 'Generate deployment files'  * Writing files... Executing step 'Prepare deployment'  * Cleaning web deployment directory... Executing step 'Build deployment structure'  * Generating data broker files...  * Compiling theme files...  * Exporting a theme...  * Exporting pages...  * Exporting metadata...  * Exporting microflows model...  * Exporting custom widgets...  * Bundling custom widgets...  * Compiling JavaScript actions... ERROR: Could not read MxBuild error file Traceback (most recent call last):   File "/opt/mendix/buildpack/buildpack/core/mxbuild.py", line 70, in build_from_source     subprocess.check_call(args, env=mono_env)   File "/usr/lib/python3.6/subprocess.py", line 311, in check_call     raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/tmp/opt/mono-5.20.1.27/bin/mono', '--config', '/tmp/opt/mono-5.20.1.27/etc/mono/config', '/opt/mendix/build/.local/mxbuild/modeler/mxbuild.exe', '--target=package', '--output=/tmp/model.mda', '--java-home=/opt/mendix/build/.local/usr/lib/jvm/Adoptium-jdk-11.0.15-Adoptium-x64', '--java-exe-path=/opt/mendix/build/.local/usr/lib/jvm/Adoptium-jdk-11.0.15-Adoptium-x64/bin/java', '--write-errors=/tmp/builderrors.json', '/opt/mendix/build/PCV.mpr']' died with <Signals.SIGKILL: 9>. During handling of the above exception, another exception occurred: Traceback (most recent call last):   File "/opt/mendix/buildpack/buildpack/core/mxbuild.py", line 117, in _log_buildstatus_errors     with codecs.open(error_file, "r", encoding="utf-8-sig") as errorfile:   File "/usr/lib/python3.6/codecs.py", line 897, in open     file = builtins.open(filename, mode, buffering) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/builderrors.json' ERROR: MxBuild returned errors: {"problems": [{"severity": "Error", "message": "Failed to build the model,please check application logs for details.", "locations": []}]} ERROR: Command '['/tmp/opt/mono-5.20.1.27/bin/mono', '--config', '/tmp/opt/mono-5.20.1.27/etc/mono/config', '/opt/mendix/build/.local/mxbuild/modeler/mxbuild.exe', '--target=package', '--output=/tmp/model.mda', '--java-home=/opt/mendix/build/.local/usr/lib/jvm/Adoptium-jdk-11.0.15-Adoptium-x64', '--java-exe-path=/opt/mendix/build/.local/usr/lib/jvm/Adoptium-jdk-11.0.15-Adoptium-x64/bin/java', '--write-errors=/tmp/builderrors.json', '/opt/mendix/build/PCV.mpr']' died with <Signals.SIGKILL: 9>. Traceback (most recent call last):   File "./compilation", line 67, in <module>     exit_code = call_buildpack_compilation()   File "./compilation", line 40, in call_buildpack_compilation     return subprocess.check_call(["/opt/mendix/buildpack/buildpack/stage.py", BUILD_PATH, CACHE_PATH, DEPS_DIR, DEPS_IDX])   File "/usr/lib/python3.6/subprocess.py", line 311, in check_call     raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/opt/mendix/buildpack/buildpack/stage.py', '/opt/mendix/build', '/tmp/buildcache', '/tmp/cf-deps', '0']' returned non-zero exit status 1. The command '/bin/sh -c mkdir -p /tmp/buildcache /tmp/cf-deps /var/mendix/build /var/mendix/build/.local &&    chmod +rx /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git /opt/mendix/buildpack/buildpack/stage.py &&    cd /opt/mendix/buildpack &&    ./compilation /opt/mendix/build /tmp/buildcache /tmp/cf-deps 0 &&    rm -fr /tmp/buildcache /tmp/javasdk /tmp/opt /tmp/downloads /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git &&    ln -s /opt/mendix/.java /opt/mendix/build &&    chown -R ${USER_UID}:0 /opt/mendix /var/mendix &&    chmod -R g=u /opt/mendix /var/mendix' returned a non-zero code: 1  
asked
1 answers
0

The error message "FileNotFoundError: [Errno 2] No such file or directory" in Python indicates that the program is trying to read a file that does not exist in the specified location. The error occurs when the file you are trying to open cannot be found in the directory you specified.

To resolve the error, you can try the following:

  1. Check the spelling and case of the file name.

  2. Ensure that the file is in the correct directory.

  3. Use the correct path to the file, including the full path or a relative path from the current working directory.

  4. Make sure that the file has the proper permissions for the program to read it.

answered