-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenesis_wasm.Dockerfile
More file actions
68 lines (58 loc) · 1.77 KB
/
genesis_wasm.Dockerfile
File metadata and controls
68 lines (58 loc) · 1.77 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
FROM ubuntu:22.04 AS build
## Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
pkg-config \
ncurses-dev \
libssl-dev \
sudo \
python3 \
curl \
openssl
## Install erlang from source
RUN git clone https://github.com/erlang/otp.git && \
cd otp && \
git checkout maint-27 && \
./configure && \
make -j16 && \
sudo make install
## Install rebar3 from source
RUN git clone https://github.com/erlang/rebar3.git && \
cd rebar3 && \
./bootstrap && \
sudo mv rebar3 /usr/local/bin/
## Install rust from source
# RUN git clone https://github.com/rust-lang/rust.git && \
# cd rust && \
# ./configure && \
# make && \
# sudo make install
## Install rust from rustup (faster, recommended)
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \
--default-toolchain 1.95 -y
ENV PATH="/root/.cargo/bin:${PATH}"
## Install Node.js with nvm
ARG NODE_VERSION='22.18.0'
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \
\. "$HOME/.nvm/nvm.sh" && \
export NVM_DIR="$HOME/.nvm" && \
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
nvm install $NODE_VERSION && \
nvm use $NODE_VERSION && \
nvm alias default $NODE_VERSION
ENV NVM_DIR="/root/.nvm"
ENV PATH="$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH"
WORKDIR /app
ARG VERSION='edge'
RUN git clone https://github.com/permaweb/hyperbeam.git --depth 1 . && \
git checkout $VERSION
RUN rebar3 compile
CMD [ "rebar3", "as", "genesis_wasm", "shell" ]
FROM build AS release
COPY --from=build /app /app
COPY config.flat /app/config.flat
RUN rebar3 as genesis_wasm release
WORKDIR /app/_build/genesis_wasm/rel/hb/
CMD [ "./bin/hb", "foreground" ]