Sign inSign up

hjr3/lucet

By hjr3

•Updated over 7 years ago

Image
0

1.0K

hjr3/lucet repository overview

⁠hjr3/lucet

A container that has lucet already built.

See https://github.com/fastly/lucet⁠ for details on lucet.

⁠Example

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

⁠Dockerfile

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

Tag summary

Content type

Image

Digest

Size

102 MB

Last updated

over 7 years ago

docker pull hjr3/lucet