-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
96 lines (88 loc) · 2.75 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
94
95
96
ARG UBUNTU_VERSION=20.04
FROM ubuntu:${UBUNTU_VERSION}
ENV DEBIAN_FRONTEND=nonintercative
# development dependencies
RUN apt-get update -y && apt-get install -y \
automake \
build-essential \
g++\
git \
jq \
libicu-dev \
libffi-dev \
libgmp-dev \
liblzma-dev \
libncursesw5 \
libpq-dev \
libssl-dev \
libsystemd-dev \
libtinfo-dev \
libtool \
make \
pkg-config \
tmux \
wget \
zlib1g-dev libreadline-dev libnuma-dev \
&& if test "$(arch)" != 'x86_64'; then apt-get install -y llvm-12; fi && rm -rf /var/lib/apt/lists/*
ARG CABAL_VERSION=3.10.3.0
ARG GHC_VERSION=9.4.8
ARG IOHK_LIBSODIUM_GIT_REV=66f017f16633f2060db25e17c170c2afa0f2a8a1
ARG IOKH_LIBSECP251_GIT_REV=ac83be33d0956faf6b7f61a60ab524ef7d6a473a
# install secp2561k library with prefix '/'
RUN git clone https://github.com/bitcoin-core/secp256k1 &&\
cd secp256k1 \
&& git fetch --all --tags &&\
git checkout ${IOKH_LIBSECP251_GIT_REV} \
&& ./autogen.sh && \
./configure --prefix=/usr --enable-module-schnorrsig --enable-experimental && \
make && \
make install && cd .. && rm -rf ./secp256k1
# install libsodium from sources with prefix '/'
RUN git clone https://github.com/input-output-hk/libsodium.git &&\
cd libsodium \
&& git fetch --all --tags &&\
git checkout ${IOHK_LIBSODIUM_GIT_REV} \
&& ./autogen.sh && \
./configure --prefix=/usr && \
make && \
make install && cd .. && rm -rf ./libsodium
# install libblst
RUN git clone https://github.com/supranational/blst \
&& cd blst \
&& git checkout v0.3.10 \
&& ./build.sh \
&& echo '\
prefix=/usr/local\n\
exec_prefix=${prefix}\n\
libdir=${exec_prefix}/lib\n\
includedir=${prefix}/include\n\
\n\
Name: libblst\n\
Description: Multilingual BLS12-381 signature library\n\
URL: https://github.com/supranational/blst\n\
Version: 0.3.10\n\
Cflags: -I${includedir}\n\
Libs: -L${libdir} -lblst\n\
' >libblst.pc && ls\
&& mkdir -p /usr/local/lib/pkgconfig /usr/local/lib /usr/local/include \
&& cp libblst.pc /usr/local/lib/pkgconfig/ \
&& cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ \
&& cp libblst.a /usr/local/lib \
&& cd .. && rm -rf ./blst
# install cabal
RUN wget --secure-protocol=TLSv1_2 \
"https://downloads.haskell.org/~cabal/cabal-install-${CABAL_VERSION}/cabal-install-${CABAL_VERSION}-$(arch)-linux-deb10.tar.xz" && \
tar -xf *.tar.xz &&\
rm *.tar.xz &&\
mv cabal /usr/local/bin/
# install ghc from sources
WORKDIR /app/ghc
RUN wget --secure-protocol=TLSv1_2 \
"https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-$(arch)-deb10-linux.tar.xz" &&\
tar -xf *.tar.xz &&\
rm *.tar.xz \
&& ls -la \
&& cd "$(ls | grep ghc)" \
&& ./configure && make install \
&& cd .. && rm -rf ./*
ENV PATH="${PATH}:/usr/lib/llvm-12/bin"