Hello Jessica Bai
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Based on the issue description, looks like the error is caused by a mismatch in the architecture of the container image and the host machine. The error message "standard_init_linux.go:228: exec user process caused: exec format error" usually indicates that the binary format of the container image is not compatible with the host machine. This could happen if you are trying to run an ARM64-based image on an AMD64-based machine or vice versa.
Based on the command you used to build the image, it seems like you are building a multi-architecture image that supports both linux/amd64
and linux/arm64
. However, when you run the container using the docker run
command, it seems like you are running it on a machine that does not support the arm64
architecture.
To fix this issue, you can try running the container on a machine that supports the arm64
architecture. Alternatively, you can try building the container image only for the linux/amd64
architecture, which is the most common architecture for servers and desktops.
To build the container image only for the linux/amd64
architecture, you can use the following command**:**
docker build --no-cache --platform linux/amd64 -t myapi .
This command will build the container image only for the linux/amd64
architecture. You can then push the image to Azure Container Registry and try running it on a machine that supports the linux/amd64
architecture.
I hope this helps.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.