container2wasm icon indicating copy to clipboard operation
container2wasm copied to clipboard

c2w CLI does not work on Container Environments

Open sr229 opened this issue 1 year ago • 4 comments

Trying to run c2w on a Cloud IDE utilising either a Firecracker VM or Docker in its backend results in c2w not working because it tries to mount /rootfs/dev/null which is not permitted by the environment.

This is replicable using Gitpod or CSB.

image

sr229 avatar Jul 06 '24 08:07 sr229

Thanks for posting that issue. Currently that file is created during image conversion but yes, that won't work in some environment and that should be created during runtime.

ktock avatar Jul 09 '24 07:07 ktock

I tried something here https://github.com/microchipgnu/container4container2wasm

Take a look and let me know if this makes sense.

It worked for me, but looking for ways to improve it.

microchipgnu avatar Jul 18 '24 21:07 microchipgnu

  • https://github.com/microchipgnu/container4container2wasm/blob/ccd1789f0f474b9209158e8fa9c3e42695247409/docker_entrypoint.sh#L57-L83
DOCKER="docker"
DOCKER="podman"
DOCKER="podman-remote"
DOCKER="nerdctl"

DOCKER_BUILD="docker buildx"
DOCKER_BUILD="nerdctl build"  # buildx
DOCKER_BUILD="podman build"

Though probably just docker buildx and maybe nerdctl build work?

westurner avatar Jan 16 '25 02:01 westurner

  • podman is one alternative to the docker provisioning steps in run_conversion.sh: https://github.com/microchipgnu/container4container2wasm/blob/main/run_conversion.sh

westurner avatar Jan 16 '25 02:01 westurner