-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
76 lines (59 loc) · 2.93 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
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
72
73
74
75
76
FROM debian:stable-20250113-slim
LABEL version="0.0.1"
LABEL maintainer="[email protected]"
ARG USER="xmss-user"
ARG EASYCRYPT_RELEASE=r2025.02
# We dont use a Jasmin release because it doesnt't have jasmin2ec
ARG JASMIN_COMMIT=4ab734290304bf832095a3939032678169f114d8
SHELL ["/bin/bash", "-c"]
RUN apt-get --quiet --assume-yes update && \
apt-get --quiet --assume-yes upgrade && \
apt-get --quiet --assume-yes install apt-utils && \
apt-get --quiet --assume-yes install \
sudo wget curl git time xz-utils libicu-dev \
ocaml ocaml-native-compilers camlp4-extra opam \
autoconf debianutils libgmp-dev pkg-config zlib1g-dev \
vim build-essential python3 python3-pip m4 libgsl-dev \
libpcre3-dev jq parallel valgrind bash-completion \
libtext-diff-perl
RUN apt-get --quiet --assume-yes clean
RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudoers && \
chown root:root /etc/sudoers.d/sudoers && \
chmod 0400 /etc/sudoers.d/sudoers && \
useradd --create-home --shell /bin/bash --home-dir /home/$USER --user-group --groups sudo --uid 1001 $USER
USER $USER
WORKDIR /home/$USER
RUN curl -L https://nixos.org/nix/install > nix-install && \
sh nix-install
# Install EasyCrypt & SMT Solvers
RUN export OPAMYES=true OPAMVERBOSE=0 OPAMJOBS=$(nproc) && \
opam init --disable-sandboxing && \
opam install opam-depext && \
opam pin add -n alt-ergo 2.5.2 && \
opam install alt-ergo && \
opam clean
RUN wget --no-verbose --show-progress --progress=bar:force:noscroll --timeout=10 --waitretry=5 --tries=5 \
-O cvc4 https://github.com/CVC4/CVC4-archived/releases/download/1.8/cvc4-1.8-x86_64-linux-opt && \
sudo install -D cvc4 /usr/local/bin/
RUN wget --no-verbose --show-progress --progress=bar:force:noscroll --timeout=10 --waitretry=5 --tries=5 \
https://github.com/Z3Prover/z3/releases/download/z3-4.13.0/z3-4.13.0-x64-glibc-2.35.zip && \
unzip -j z3-4.13.0-x64-glibc-2.35.zip z3-4.13.0-x64-glibc-2.35/bin/z3 && \
sudo install -D z3 /usr/local/bin/
RUN eval $(opam env) && \
export OPAMYES=true OPAMVERBOSE=0 OPAMJOBS=$(nproc) && \
opam pin -n add easycrypt https://github.com/EasyCrypt/easycrypt.git#${EASYCRYPT_RELEASE} && \
opam depext easycrypt && \
opam install easycrypt && \
easycrypt why3config
# Install Jasmin & set ECLib
RUN git clone https://gitlab.com/jasmin-lang/jasmin-compiler.git jasmin-compiler && \
cd jasmin-compiler && git checkout ${JASMIN_COMMIT} && \
USER=$USER source /home/$USER/.nix-profile/etc/profile.d/nix.sh && \
nix-channel --update && \
cd compiler/ && nix-shell --command "make" && \
sudo install -D jasmin* /usr/local/bin/ && \
cd - && echo -e "[general]\nidirs = Jasmin:$(pwd)/eclib" > ~/.config/easycrypt/easycrypt.conf
COPY --chown=$USER:$USER . /home/$USER/xmss-jasmin
WORKDIR /home/$USER/xmss-jasmin
ENTRYPOINT ["opam", "exec", "--"]
CMD ["/bin/bash", "--login"]