Need help with the compilation issue with the docker mendix buildpack
0
Experts, I have a mendix project for which I created the deployment package. I am just trying to build and run the mendix app on the docker setup. I installed the docker on windows and the docker mendix buildpack. I followed the instructions as below to build my app (“Test-main”): docker build --build-arg BUILD_PATH=C:\Users\guda\Documents\Mendix\Test-main --build-arg ROOTFS_IMAGE=mendix/rootfs:bionic --build-arg CF_BUILDPACK=v4.9.4 --tag mendix/mendix-buildpack:v1.2 . I am getting the below compilation error. Tried a bunch of times but running into the same issue. Appreciate if one of you can help me get past this issue. NOTE: I gave the mendix project root folder as my BUILD_PATH. Sending build context to Docker daemon 2.057GB Step 1/26 : ARG ROOTFS_IMAGE=mendix/rootfs:bionic Step 2/26 : FROM ${ROOTFS_IMAGE} AS builder ---> f178c28cb197 Step 3/26 : ARG BUILD_PATH=project ---> Using cache ---> caec8a35662e Step 4/26 : ARG DD_API_KEY ---> Using cache ---> 1eee282a00d3 Step 5/26 : ARG CF_BUILDPACK=v4.5.8 ---> Using cache ---> 7acd28320700 Step 6/26 : RUN mkdir -p /opt/mendix/buildpack /opt/mendix/build && echo "CF Buildpack version ${CF_BUILDPACK}" && curl -fsSL https://github.com/mendix/cf-mendix-buildpack/archive/${CF_BUILDPACK}.tar.gz | tar xz -C /opt/mendix/buildpack --strip-components 1 && chgrp -R 0 /opt/mendix && chmod -R g=u /opt/mendix ---> Using cache ---> 4f420b2cca96 Step 7/26 : COPY scripts/compilation scripts/git /opt/mendix/buildpack/ ---> Using cache ---> 5490bace7a9a Step 8/26 : RUN chmod +rx /opt/mendix/buildpack/bin/bootstrap-python && /opt/mendix/buildpack/bin/bootstrap-python /opt/mendix/buildpack /tmp/buildcache ---> Using cache ---> 21be1635bf6b Step 9/26 : ENV PYTHONPATH "$PYTHONPATH:/opt/mendix/buildpack/lib/:/opt/mendix/buildpack/:/opt/mendix/buildpack/lib/python3.6/site-packages/" ---> Using cache ---> ea2ffcaa2fba Step 10/26 : RUN mkdir -p /tmp/buildcache /var/mendix/build /var/mendix/build/.local && chmod +rx /opt/mendix/buildpack/compilation /opt/mendix/buildpack/git /opt/mendix/buildpack/buildpack/compile.py && cd /opt/mendix/buildpack && ./compilation /opt/mendix/build /tmp/buildcache && 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 && chgrp -R 0 /opt/mendix /var/mendix && chmod -R g=u /opt/mendix /var/mendix ---> Running in a13f6004e48d INFO: Mendix project compilation phase... Traceback (most recent call last): File "/opt/mendix/buildpack/buildpack/runtime.py", line 89, in get_version with open(file_name) as file_handle: FileNotFoundError: [Errno 2] No such file or directory: '/opt/mendix/build/model/metadata.json' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/mendix/buildpack/buildpack/compile.py", line 141, in <module> preflight_check() File "/opt/mendix/buildpack/buildpack/compile.py", line 63, in preflight_check mx_version_str = runtime.get_version(BUILD_DIR) File "/opt/mendix/buildpack/buildpack/runtime.py", line 95, in get_version raise Exception("No model/metadata.json or .mpr found in archive") Exception: No model/metadata.json or .mpr found in archive
asked
Kalyan Guda
1 answers
0
It seems like your Dockerfile has a missing step. After step 7, the Dockerfile is supposed to copy your project folder into the build container, per this line:
Is your script missing this step? I would expect it to be logged as step 8, but it seems to be missing this step and moving onto the ‘chmod’ command after.