-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
93 lines (81 loc) · 2.99 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM debian:10-slim
LABEL maintainer="[email protected]"
ENV OPAM_VERSION="2.0.6"
RUN cat /proc/cpuinfo /proc/meminfo; apt-get update -y -q \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y -q --no-install-recommends \
autoconf \
automake \
bubblewrap \
build-essential \
ca-certificates \
curl \
git \
# gnupg is temporarily installed and will not be kept in the image
gnupg \
less \
m4 \
openssh-client \
pkg-config \
rlwrap \
rsync \
sudo \
time \
unzip \
&& [ -n "${OPAM_VERSION}" ] \
&& binary="opam-${OPAM_VERSION}-$(uname -m)-$(uname -s | tr '[:upper:]' '[:lower:]')" \
&& cd /tmp \
&& curl -fSOL https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/${binary} \
&& curl -fSOL https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/${binary}.asc \
&& curl -fsSL https://keybase.io/altgr/pgp_keys.asc | gpg --batch --import \
&& gpg --batch --verify ${binary}.asc ${binary} \
&& set -x \
&& mv ${binary} /usr/local/bin/opam \
&& chmod a+x /usr/local/bin/opam \
&& rm -f ${binary}.asc \
&& rm -fr /root/.gnupg \
&& DEBIAN_FRONTEND=noninteractive apt-get purge -y -q --auto-remove gnupg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Use Docker build args to set the UID/GID
ARG guest_uid=1000
ARG guest_gid=${guest_uid}
# Add Coq group and user with sudo perms
RUN groupadd -g ${guest_gid} coq \
&& useradd --no-log-init -m -s /bin/bash -g coq -G sudo -p '' -u ${guest_uid} coq \
# Create dirs for user scripts
&& mkdir -p -v /home/coq/bin /home/coq/.local/bin \
&& chown coq:coq /home/coq/bin /home/coq/.local /home/coq/.local/bin
# Load travis.sh at login
COPY travis.sh /etc/profile.d/
WORKDIR /home/coq
USER coq
ENV NJOBS="2"
ENV COMPILER="4.05.0"
ENV COMPILER_EDGE="4.07.1+flambda"
ENV OPAMPRECISETRACKING="1"
ENV OCAMLFIND_VERSION="1.8.1"
ENV DUNE_VERSION="2.4.0"
RUN ["/bin/bash", "--login", "-c", "set -x \
&& opam init --auto-setup --yes --jobs=${NJOBS} --compiler=${COMPILER_EDGE} --disable-sandboxing \
&& eval $(opam env) \
&& opam repository add --all-switches --set-default coq-released https://coq.inria.fr/opam/released \
&& opam update -y \
&& opam install -y -j 1 opam-depext \
&& opam pin add -n -k version ocamlfind ${OCAMLFIND_VERSION} \
&& opam pin add -n -k version dune ${DUNE_VERSION} \
&& opam pin add -n -k version num 1.3 \
&& opam install -y -v -j ${NJOBS} ocamlfind dune num \
&& opam clean -a -c -s --logs \
&& opam config list && opam list"]
RUN ["/bin/bash", "--login", "-c", "set -x \
&& opam switch create -y ${COMPILER} \
&& eval $(opam env) \
&& opam install -y -j 1 opam-depext \
&& opam pin add -n -k version ocamlfind ${OCAMLFIND_VERSION} \
&& opam pin add -n -k version dune ${DUNE_VERSION} \
&& opam pin add -n -k version num 0 \
&& opam install -y -v -j ${NJOBS} ocamlfind dune num \
&& opam clean -a -c -s --logs \
&& opam config list && opam list"]
ENTRYPOINT ["opam", "exec", "--"]
CMD ["/bin/bash", "--login"]