-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathgit.Dockerfile
More file actions
79 lines (63 loc) · 2.6 KB
/
git.Dockerfile
File metadata and controls
79 lines (63 loc) · 2.6 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
69
70
71
72
73
74
75
76
77
78
79
# This Dockerfile should be run from the root EverParse directory
FROM ubuntu:24.04 AS base
# For the `deps` and `build` layers
# sudo for the Docker image
RUN apt-get update && apt-get install --yes --no-install-recommends \
ca-certificates \
curl \
git \
pkg-config \
libffi-dev \
libgmp-dev \
libsqlite3-dev \
libssl-dev \
time \
opam \
sudo
# Create a new user and give them sudo rights
RUN useradd -d /home/test test
RUN echo 'test ALL=NOPASSWD: ALL' >> /etc/sudoers
RUN mkdir /home/test
RUN chown test:test /home/test
USER test
ENV HOME=/home/test
WORKDIR $HOME
# install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Automatically set up Rust environment
SHELL ["/usr/bin/env", "BASH_ENV=/home/test/.cargo/env", "/bin/bash", "-c"]
# Set up code-server
RUN curl -L --output code-server.deb https://github.com/coder/code-server/releases/download/v4.103.2/code-server_4.103.2_amd64.deb \
&& sudo dpkg -i code-server.deb \
&& rm code-server.deb
RUN curl -L --output fstar-vscode-assistant.vsix https://github.com/FStarLang/fstar-vscode-assistant/releases/download/v0.19.2/fstar-vscode-assistant-0.19.2.vsix \
&& code-server --install-extension fstar-vscode-assistant.vsix \
&& rm fstar-vscode-assistant.vsix
# Bring in the contents
ARG CACHE_BUST
RUN sudo mkdir /mnt/everparse && sudo chown test:test /mnt/everparse
ARG CI_REPO=project-everest/everparse
ARG CI_BRANCH=master
RUN git clone --recurse-submodules --branch $CI_BRANCH https://github.com/$CI_REPO /mnt/everparse && echo $CACHE_BUST
WORKDIR /mnt/everparse
# For the release process: check if the current hash matches the hash being released
ARG CI_HASH
RUN if [[ -n "$CI_HASH" ]] ; then [[ "$CI_HASH" = "$(git rev-parse HEAD)" ]] ; fi
FROM base AS deps
ARG CI_THREADS
RUN sudo apt-get update && make -j"$(if test -z "$CI_THREADS" ; then nproc ; else echo $CI_THREADS ; fi)" deps
RUN cp src/package/start-code-server.sh .
# Automatically set up Rust environment
ENTRYPOINT ["/usr/bin/env", "BASH_ENV=/home/test/.cargo/env", "/mnt/everparse/shell.sh", "-c"]
CMD ["/bin/bash", "-i"]
SHELL ["/usr/bin/env", "BASH_ENV=/home/test/.cargo/env", "/mnt/everparse/shell.sh", "-c"]
FROM deps AS build
RUN OTHERFLAGS='--admit_smt_queries true' make -j"$(if test -z "$CI_THREADS" ; then nproc ; else echo $CI_THREADS ; fi)" all
# For the `test` layer
RUN sudo apt-get update && sudo apt-get install --yes --no-install-recommends \
cmake \
clang \
python3-pip \
python3-venv
FROM build AS test
RUN OTHERFLAGS='--admit_smt_queries true' make -j"$(if test -z "$CI_THREADS" ; then nproc ; else echo $CI_THREADS ; fi)" test