-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (31 loc) · 1.43 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
44
45
# syntax=docker.io/docker/dockerfile:1.4
FROM --platform=linux/riscv64 cartesi/python:3.10-slim-jammy as build-stage
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential=12.9ubuntu3 \
&& rm -rf /var/lib/apt/lists/* \
&& find /var/log \( -name '*.log' -o -name '*.log.*' \) -exec truncate -s 0 {} \;
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install -r requirements.txt --no-cache \
&& find /opt/venv -type d -name __pycache__ -exec rm -r {} +
# runtime stage: produces final image that will be executed
FROM --platform=linux/riscv64 cartesi/python:3.10-slim-jammy
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
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=build-stage /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:/opt/cartesi/bin:${PATH}"
WORKDIR /opt/cartesi/dapp
COPY echo-voucher.py .
ENV ROLLUP_HTTP_SERVER_URL="http://127.0.0.1:5004"
ENTRYPOINT ["rollup-init"]
CMD ["python3", "echo-voucher.py"]