-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (27 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM rust:1.82.0-bullseye AS dev
RUN apt-get update \
&& apt-get install -y lsb-release wget software-properties-common gnupg \
&& bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" -- 18 \
&& apt-get install -y libpolly-18-dev libzstd-dev
RUN mkdir -p /opt/wasi-sdk \
&& cd /opt/wasi-sdk \
&& wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/wasi-sdk-24.0-x86_64-linux.tar.gz \
&& tar xvf wasi-sdk-24.0-x86_64-linux.tar.gz \
&& rm wasi-sdk-24.0-x86_64-linux.tar.gz \
&& cd .. \
&& echo "export WASI_SDK_PATH=/opt/wasi-sdk/wasi-sdk-24.0-x86_64-linux" >> /etc/profile.d/wasi-sdk.sh
RUN curl https://wasmtime.dev/install.sh -sSf | bash
RUN cargo install --locked wasm-tools
ENV WASI_SDK_PATH=/opt/wasi-sdk/wasi-sdk-24.0-x86_64-linux
WORKDIR /mnt
CMD ["bash"]
FROM dev AS test
WORKDIR /usr/local/src/lang
COPY . .
RUN cargo test -- --test-threads=1 \
&& cargo clean
FROM test AS run
RUN cargo build --release \
&& cp /usr/local/src/lang/target/release/lang2 /usr/local/bin/lang2 \
&& cargo clean
ENTRYPOINT ["/usr/local/bin/lang2"]