dockeribm-cloudibm-cloud-code-engine

IBM Cloud Code Engine: Locally built container image gives exec format error when deployed


I have created a container image on my machine (Mac). When testing it locally, all works fine. But the following does not work:

It produces this error:

exec /usr/local/bin/docker-entrypoint.sh: exec format error

I’ve looked in to the docker-entrypoint.sh and that seems to be ok. What is wrong? How do I address it?


Solution

  • The reason for the problem is the chip architecture. IBM Cloud Code Engine is based on the Intel x86 architecture, many Mac computers use ARM 64 (M1 or similar). There are two options to work around it:

    1. Use Code Engine to build the container images.
    2. Use docker build --platform linux/amd64 to specify the build platform in your local builds.

    Also, check out the Code Engine FAQs and the Troubleshooting section.