forked from MinaProtocol/mina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-toolchain
More file actions
106 lines (85 loc) · 3.64 KB
/
Dockerfile-toolchain
File metadata and controls
106 lines (85 loc) · 3.64 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM ocaml/opam2:debian-9-ocaml-4.08
# if updated, also change in Dockerfile
ARG OCAML_VERSION=4.07.1
# location of repo used for pins and external package commits
ARG CODA_DIR=/coda
# location of external packages
ARG EXTERNAL_PKG_DIR=$CODA_DIR/src/external
# don't keep sources, to force reinstall of pinned packages from Coda sources
# and to keep Docker image reasonable size
ARG OPAMKEEPBUILDDIR=false
ARG OPAMREUSEBUILDDIR=false
# OS package dependencies
RUN sudo apt-get update && sudo apt-get install --yes \
cmake \
jq \
libboost-dev \
libboost-program-options-dev \
libffi-dev \
libgmp-dev \
libgmp3-dev \
libjemalloc-dev \
libpq-dev \
libprocps-dev \
libsodium-dev \
libssl-dev \
lsb \
m4 \
nodejs \
pandoc \
patchelf \
python \
perl \
pkg-config \
python-jinja2 \
python-pip \
python3-pip \
rubygems \
zlib1g-dev \
libbz2-dev \
apt-transport-https
RUN sudo pip install awscli readchar
RUN sudo pip3 install sexpdata
RUN sudo gem install deb-s3
RUN VER="19.03.4" && \
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz && \
tar -xz -C /tmp -f /tmp/docker-$VER.tgz && \
sudo mv /tmp/docker/* /usr/bin
# Google Cloud tools
RUN export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \
sudo apt-get update -y && sudo apt-get install google-cloud-sdk kubectl -y
# Helm tools
RUN curl https://baltocdn.com/helm/signing.asc | apt-key add - && \
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list && \
sudo apt-get update -y && sudo apt-get install helm -y
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o /tmp/rust_install.sh
RUN chmod +x /tmp/rust_install.sh
RUN /tmp/rust_install.sh -y
RUN export PATH="$PATH:$HOME/.cargo/bin"
RUN echo 'export PATH="$PATH:$HOME/.cargo/bin"' >> /home/opam/.bashrc
# Get yarn + nodejs
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
RUN sudo apt update && sudo apt install nodejs yarn
# Source copy of rocksdb
RUN sudo git clone https://github.com/facebook/rocksdb -b v5.17.2 /rocksdb
# This builds and installs just the static lib for us
RUN cd /rocksdb && sudo make static_lib PORTABLE=1 -j$(nproc) && sudo cp librocksdb.a /usr/local/lib/librocksdb_coda.a && sudo rm -rf /rocksdb && sudo strip -S /usr/local/lib/librocksdb_coda.a
# OPAM dependencies
RUN git -C /home/opam/opam-repository pull
RUN opam update -y && opam upgrade -y
RUN mkdir --mode=700 /home/opam/.gnupg
RUN echo "disable-ipv6" >> /home/opam/.gnupg/dirmngr.conf
# we used to delete the repo here
# we now leave it intact, in case updating OPAM in CI requires pinned package sources
RUN sudo apt-get install --yes wget
RUN cd /usr/lib && sudo wget https://dl.google.com/go/go1.13.10.linux-amd64.tar.gz && sudo tar -xvf go1.13.10.linux-amd64.tar.gz && sudo rm go1.13.10.linux-amd64.tar.gz
RUN echo 'export PATH="$PATH:/usr/lib/go/bin"' >> /home/opam/.bashrc
# The Ocaml images are set to London time for reason. UTC makes reading the logs
# easier.
RUN sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime
# Unlimit stack for future shells that might use spacetime
RUN echo ulimit -s unlimited >> ~/.bashrc