A container that has lucet already built.
See https://github.com/fastly/lucet for details on lucet.
Save the following C source code as hi2u.c:
#include <stdio.h>
int main(void)
{
puts("Hello world");
return 0;
}
Run the following commands:
$ docker run --rm -it -v "$(pwd)":/usr/local/src hjr3/lucet wasm32-unknown-wasi-clang -Ofast -o hi2u.wasm hi2u.c
$ docker run --rm -it -v "$(pwd)":/usr/local/src hjr3/lucet lucetc-wasi -o hi2u.so hi2u.wasm
$ docker run --rm -it -v "$(pwd)":/usr/local/src hjr3/lucet lucet-wasi hi2u.so
Hello world
FROM fastly/lucet:latest
RUN git clone https://github.com/fastly/lucet.git
RUN cd lucet && git submodule init && git submodule update && make install
FROM ubuntu:xenial
# lucetc-wasi requires /usr/bin/ld
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
binutils \
&& rm -rf /var/lib/apt/lists/*
# Copies /opt/lucet and /opt/wasi-sdk in one statement
COPY --from=0 /opt /opt
ENV WASI_SDK=/opt/wasi-sdk
ENV PATH=/opt/lucet/bin:/opt/wasi-sdk/bin:$PATH
WORKDIR /usr/local/src
Content type
Image
Digest
Size
102 MB
Last updated
over 7 years ago
docker pull hjr3/lucet