forked from cartesi/sunodo-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (33 loc) · 1.32 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
43
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=linux/riscv64 riscv64/ubuntu:22.04 as builder
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends build-essential=12.9ubuntu3 lua5.4=5.4.4-1 liblua5.4-dev=5.4.4-1 luarocks=3.8.0+dfsg1-1
rm -rf /var/lib/apt/lists/*
luarocks install --lua-version=5.4 luasocket 3.1.0-1
luarocks install --lua-version=5.4 dkjson 2.6-1
EOF
FROM --platform=linux/riscv64 riscv64/ubuntu:22.04
LABEL io.sunodo.sdk_version=0.2.0
LABEL io.cartesi.rollups.ram_size=128Mi
ARG MACHINE_EMULATOR_TOOLS_VERSION=0.12.0
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends \
busybox-static=1:1.30.1-7ubuntu3 \
ca-certificates=20230311ubuntu0.22.04.1 \
curl=7.81.0-1ubuntu1.14 \
liblua5.4-dev=5.4.4-1 \
lua5.4=5.4.4-1
curl -fsSL https://github.com/cartesi/machine-emulator-tools/releases/download/v${MACHINE_EMULATOR_TOOLS_VERSION}/machine-emulator-tools-v${MACHINE_EMULATOR_TOOLS_VERSION}.tar.gz \
| tar -C / --overwrite -xvzf -
rm -rf /var/lib/apt/lists/*
EOF
COPY --from=builder /usr/local/lib/lua /usr/local/lib/lua
COPY --from=builder /usr/local/share/lua /usr/local/share/lua
ENV PATH="/opt/cartesi/bin:/opt/cartesi/dapp:${PATH}"
WORKDIR /opt/cartesi/dapp
COPY . .
ENV ROLLUP_HTTP_SERVER_URL="http://127.0.0.1:5004"
ENTRYPOINT ["rollup-init"]
CMD ["lua", "dapp.lua"]