|
1 | | -FROM debian:bullseye-slim |
2 | | -ARG WASM_EDGE_VERSION="0.10.0" |
| 1 | +FROM fedora:rawhide |
| 2 | +ARG WASM_EDGE_VERSION="0.11.0" |
3 | 3 |
|
4 | | -RUN apt-get update && apt-get install -y make git gcc build-essential pkgconf libtool \ |
5 | | - libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev \ |
6 | | - go-md2man autoconf python3 automake curl libc6 |
| 4 | +# Install the deps for building crun |
| 5 | +RUN dnf update -y && dnf install -y make python git gcc automake autoconf libcap-devel \ |
| 6 | + systemd-devel yajl-devel libseccomp-devel pkg-config \ |
| 7 | + go-md2man glibc-static python3-libmount libtool buildah podman |
7 | 8 |
|
8 | | -#ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib |
9 | | -RUN rm /etc/ld.so.conf.d/libc.conf |
| 9 | +# Install WasmEdge |
10 | 10 | RUN curl -sSf -o install.sh https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh |
11 | | -RUN bash ./install.sh -p /usr/local -v $WASM_EDGE_VERSION |
| 11 | +RUN bash ./install.sh -p /usr/local -v $WASM_EDGE_VERSION |
| 12 | + |
| 13 | +# The hello_wasm contains: |
| 14 | +# 1. The example rust application called hello, which will print something to console. |
| 15 | +# 2. The Containerfile for building the image including hello.wasm |
| 16 | +ADD hello_wasm /hello_wasm |
| 17 | + |
| 18 | +# Install Rust for building wasm application |
| 19 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| 20 | +SHELL ["/bin/bash", "-c"] |
| 21 | +RUN source "$HOME/.cargo/env" && \ |
| 22 | + rustup target add wasm32-wasi && \ |
| 23 | + cd /hello_wasm/hello && \ |
| 24 | + cargo build --release --target wasm32-wasi && \ |
| 25 | + cp ./target/wasm32-wasi/release/hello.wasm /hello_wasm && \ |
| 26 | + cd / && \ |
| 27 | + rm -rf /hello_wasm/hello |
12 | 28 |
|
13 | 29 | COPY run-tests.sh /usr/local/bin |
14 | 30 |
|
|
0 commit comments