forked from hyperlight-dev/hyperlight-wasm-http-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (58 loc) · 2.08 KB
/
Dockerfile
File metadata and controls
71 lines (58 loc) · 2.08 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
## Dockerfile for devcontainer
FROM mcr.microsoft.com/devcontainers/base:bookworm AS base
ARG USER=vscode
ARG GROUP=vscode
ENV HOME="/home/${USER}"
ENV PATH="$HOME/.cargo/bin:$PATH"
# Install dependencies
RUN apt-get update \
&& apt-get -y install \
build-essential \
cmake \
curl \
gdb \
git \
gnupg \
libc6 \
lsb-release \
make \
pkg-config \
software-properties-common \
sudo \
wget \
musl-tools
ARG LLVM_VERSION=18
# Install llvm
RUN wget https://apt.llvm.org/llvm.sh \
&& chmod +x ./llvm.sh \
&& sudo ./llvm.sh ${LLVM_VERSION} clang clang-tools-extra \
&& sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/ld.lld /usr/bin/ld.lld \
&& sudo ln -s /usr/lib/llvm-${LLVM_VERSION}/bin/clang /usr/bin/clang
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs
FROM base AS dev
# Make sure the devcontainer user has sudo access
RUN chown -R "${USER}:${GROUP}" /home/${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Persist bash history
RUN SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" \
&& mkdir /commandhistory \
&& touch /commandhistory/.bash_history \
&& chown -R "${USER}" /commandhistory \
&& echo "$SNIPPET" >> "/home/${USER}/.bashrc"
USER $USER
ARG RUST_TOOLCHAIN=1.89
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& rustup default ${RUST_TOOLCHAIN} \
&& rustup target add x86_64-unknown-linux-gnu \
&& rustup target add x86_64-unknown-linux-musl \
&& rustup target add x86_64-unknown-none \
&& rustup target add wasm32-wasip1 \
&& rustup toolchain add nightly-x86_64-unknown-linux-gnu \
&& cargo install just \
&& cargo install cargo-component \
&& cargo install cargo-hyperlight \
&& cargo install hyperlight-wasm-aot --locked --version 0.12.0 \
&& cargo install wasmtime-cli --locked --version 36.0.6