Container App fails to start up with "standard_init_linux.go:228: exec user process caused: exec format error"
Asked Answered
G

1

10

Was using Azure Container Apps and on deploy the command failed to provision the container and told me to check log analytics. When I checked I only see a single log from the container that says:

standard_init_linux.go:228: exec user process caused: exec format error

What's the issue here?

Groggery answered 24/11, 2021 at 4:37 Comment(0)
G
21

This error can happen when the arch of the docker image doesn't match the runtime environment. Azure Container Apps runs on amd64 arch, and I built and published these docker containers from a Mac M1 ARM processor. I had two options here:

  1. Use features like docker buildx build --platform linux/amd64 to emulator an amd64 and publish a version there
  2. Use some remote build (like GitHub Actions) to build the container on an arch that matches Azure Container Apps environment
Groggery answered 24/11, 2021 at 4:37 Comment(1)
Alternatively, adding platform: linux/amd64 to your docker-compose.yml should do the trick with the least amount of effort, as seen here: #69709366Herniorrhaphy

© 2022 - 2024 — McMap. All rights reserved.