WasmEdge: exec container process `/add.wasm`: Exec format error error while running runtime: exit status 1

Description

I want to create and run the container image for test. I referred to this article(https://wasmedge.org/book/en/kubernetes/demo/wasi.html). I have followed the mentioned steps to build and install buildah. At the same time, I builded image using the tool buildah.

$ sudo buildah images
REPOSITORY                    TAG      IMAGE ID       CREATED       SIZE
localhost/wasm-wasi-example   latest   d230f65c92e0   4 hours ago   2.01 MB

After, i creates a new working container using the command sudo buidah from localhost/wasm-wasi-example:latest

sudo buildah containers
CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
67ac345ac1a7     *     d230f65c92e0 localhost/wasm-wasi-example:l... wasm-wasi-example-working-container

Everything is normal up to here, as expected.

However, i want to run a command inside of the container, the following error occurs, exec container process `/add.wasm`: Exec format error error while running runtime: exit status 1. One more question, If I want tocrun to manage a container, how will i do? I find that it is wrong to use crun to run a container that is created by buildah.

Current State

I cannot manage a container using crun or buildah

Expected

Input: sudo buildah run wasm-wasi-example-working-container /add.wasm 2 2 Output: 4

Environment

x86 Ubuntu20.04

  • Hardware Architecture: (e.g. x86_64 or aarch64)
  • Operating system: (e.g. Ubuntu 20.04 or CentOS 7.6)

The following information is optional. Please provide them only if you have built from source.

  • C++ Compiler version:
  • CMake version:
  • CMake flags: (e.g. -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_AOT_RUNTIME=ON)
  • Boost version:

Steps to Reproduce

wasm app https://github.com/second-state/wasm-learning/tree/master/cli/add build image https://wasmedge.org/book/en/kubernetes/demo/wasi.html

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (12 by maintainers)

Most upvoted comments

It works! Thank you for your patience! My fault was in assuming that the args and annotations properties of the JSON file were no longer needed if they were “baked in” to the image.

I have exhausted my curiosity for the day, but I am very excited to move forward and build an image for React streaming SSR.

Thank you again for your time.