I’m running a Jetson Nano app on my openBalena server (latest version). I’m trying to deploy a simple app to the device that is built on my Ubuntu host (balena-cli v12.2.0).
Even after using --emulated option with balena deploy, my container is throwing [dashboard] standard_init_linux.go:207: exec user process caused "exec format error"
That error possibly indicates that a binary for the wrong architecture is used, but it could be something else as well. Can you please paste the output of the balena deploy command so that we can compare it with what I get locally on my Arch host?
[Info] No "docker-compose.yml" file found at "/test/nano-nginx"
[Info] Creating default composition with source: "/test/nano-nginx"
[Info] Building for aarch64/jetson-nano
[Build] Building services...
[Build] main Preparing...
[Info] Installing qemu for aarch64 emulation...
[Info] Emulation is enabled
[Build] main Step 1/2 : FROM nginx:alpine
[Build] main ---> 6f715d38cfe0
[Build] main Step 2/2 : COPY [".balena/qemu-execve","/tmp/qemu-execve"]
[Build] main ---> cad8acf3af80
[Build] main Successfully built cad8acf3af80
[Build] main Successfully tagged nano-nginx_main:latest
[Build] main Waiting...
[Build] Built 1 service in 0:18
[Info] Creating release...
[Info] Pushing images to registry...
[Info] Saving release...
[Success] Deploy succeeded!
[Success] Release: 4d133148271b006fa27f339b99022647
Hi @abmg – thanks for the additional info. I was able to duplicate your problems when deploying to my Jetson Nano, using your Dockerfile. I think what’s happening here is that the image is being built using an incorrect architecture; if I add the file utility to the nginx:alpine container, I can see that:
when I run balena deploy locally, the nginx binary is for x86_64 (my laptop’s architecture); on my Nano, I see the exec format error you saw;
but when I run balena push, which uses the balena Cloud builders, the binary is for ARM aarch64 architecture, and on the Nano everything is fine.
FROM arm64v8/nginx as the first line of the Dockerfile
balena deploy JetsonNanoApp --emulated --build as the command
A quick search turned up this issue and this forum post, which offer a good background on what’s going on here.
One thing I’m not sure about is whether the balena CLI should be fetching the correct image when using nginx:alpine; I will check with a colleague of mine and get back to you. In the meantime, can you give this workaround a try and let us know if it works for you?
Hi there – I’ve checked with my colleague, and for now the CLI does require you to specify the architecture when running balena deploy. There are two issues tracking this, which I invite you to subscribe to:
One alternative to choosing the arm64v8/nginx image is to look for the sha256 digest of the image for the desired architecture, and use that in the Dockerfile. You can find these on the Dockerhub image page (https://hub.docker.com/_/nginx?tab=tags) under Tags -> Image, then click on the digest for your architecture. You should end up at a page like this one, and see the sha256 sum. You can then use it in your Dockerfile like so:
FROM nginx:alpine@sha256:8d99a3e08d0f07ca0fdf1db5c56b1f30d9cc97af5458ecfac604b8887cba289a
Please give that a try and let us know if you run into any problems.