-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (41 loc) · 1.97 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (41 loc) · 1.97 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
# komet-node runtime image.
#
# Built on the K Framework base image (which already bundles K and a matching
# Z3), then layered with the komet-node Python package and its kompiled K
# semantics. komet-node only needs `wat2wasm` (wabt) at runtime to turn the
# `.wat` test contracts into wasm -- it does not invoke stellar-cli/soroban or
# cargo, so the Rust/Soroban toolchain is intentionally left out to keep the
# image small.
#
# K_VERSION is supplied by the release workflow from deps/k_release.
ARG K_VERSION
FROM runtimeverificationinc/kframework-k:ubuntu-jammy-${K_VERSION}
ARG PYTHON_VERSION=3.10
RUN apt-get -y update \
&& apt-get -y install --no-install-recommends \
curl \
git \
graphviz \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python3-pip \
wabt \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
ARG USER_ID=1010
ARG GROUP_ID=1010
RUN groupadd -g ${GROUP_ID} user \
&& useradd -m -u ${USER_ID} -s /bin/bash -g user user
USER user
WORKDIR /home/user
COPY --chown=user:user . komet-node
ENV PATH=/home/user/.local/bin:${PATH}
# Installs komet-node together with its dependencies (the `komet` package, which
# carries the Soroban K semantics source, and the matching `kframework` pyk).
# `--user` installs into ~/.local (already on PATH) and `--no-cache-dir` keeps
# pip's download cache out of the image layer.
RUN pip install --no-cache-dir --user ./komet-node \
&& rm -rf komet-node
# Pre-kompile the K semantics so the container is ready to serve immediately.
# The sources come from the installed packages, so the checkout is no longer needed.
RUN kdist --verbose build -j2 'komet-node.*' 'soroban-semantics.*'