Bugzilla – Bug 1216104
Podman does not respect annotations
Last modified: 2023-10-12 07:28:23 UTC
Executing an image that has the annotation "module.wasm.image/variant=compat" seems to have no effect on Podman. The following command fails: > podman run hello-wasm > {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-10T17:19:12.215791Z"} While the following command works: > podman run --annotation module.wasm.image/variant=compat hello-wasm > Hello WebAssembly! The image has the correct annotation, but Podman does not respect it. In my assumption, Podman should respect the annotation in the image. The image was built with Buildah: > buildah build --annotation "module.wasm.image/variant=compat" -t hello-wasm Here is a snipped of the image object: > podman image inspect hello-wasm > [ > { > // omitted data > "Annotations": { > "module.wasm.image/variant": "compact", > "org.opencontainers.image.base.digest": "", > "org.opencontainers.image.base.name": "" > }, > // omitted data > } > ] This command seems to work on other distributions as it is documented in many places around the internet, for example: https://opensource.com/article/22/10/wasm-containers
Try installing crun. The default runtime on opensuse Tumbleweed is runc, where running wasm binaries doesn't appear to work.
(In reply to Dan Čermák from comment #1) > Try installing crun. The default runtime on opensuse Tumbleweed is runc, > where running wasm binaries doesn't appear to work. I do have crun installed and Podman picks the correct runtime based on annotations.
It fails even if I force to use crun. > podman run hello-wasm > {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-12T07:24:48.688437Z"} > podman --runtime=/usr/bin/crun run hello-wasm > {"msg":"exec container process `/hello.wasm`: Exec format error","level":"error","time":"2023-10-12T07:24:58.163032Z"}
To my surprise, it works if I do: > podman --runtime=/usr/bin/crun-wasm run hello-wasm > Hello WebAssembly! /usr/bin/crun-wasm is link to /usr/bin/crun, it is the same binary. alexandre@localhost:~/workspace/hello> /usr/bin/crun -v crun version 1.9 commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3 rundir: /run/user/1000/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL alexandre@localhost:~/workspace/hello> /usr/bin/crun-wasm -v crun version 1.9 commit: a538ac4ea1ff319bcfe2bf81cb5c6f687e2dc9d3 rundir: /run/user/1000/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL