-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
87 lines (79 loc) · 2.52 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
FROM debian:bookworm-slim as builder
ARG CABAL_VERSION=3.10.2.0
ARG GHC_VERSION=9.6.4
ARG LIBSODIUM_REF=dbb48cce
ARG SECP256K1_REF=v0.3.2
ARG BLST_REF=v0.3.11
WORKDIR /code
# system dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
apt-get install -y \
automake \
build-essential \
pkg-config \
libffi-dev \
libgmp-dev \
liblmdb-dev \
libnuma-dev \
libssl-dev \
libsystemd-dev \
libtinfo-dev \
llvm-dev \
zlib1g-dev \
make \
g++ \
tmux \
git \
jq \
wget \
libncursesw5 \
libtool \
autoconf
# GHC
ENV GHC_VERSION=${GHC_VERSION}
RUN wget https://downloads.haskell.org/~ghc/${GHC_VERSION}/ghc-${GHC_VERSION}-$(uname -m)-deb10-linux.tar.xz \
&& tar -xf ghc-${GHC_VERSION}-$(uname -m)-deb10-linux.tar.xz \
&& rm ghc-${GHC_VERSION}-$(uname -m)-deb10-linux.tar.xz \
&& cd ghc-${GHC_VERSION}-$(uname -m)-unknown-linux \
&& ./configure \
&& make install
# cabal
ENV CABAL_VERSION=${CABAL_VERSION}
ENV PATH="/root/.cabal/bin:/root/.ghcup/bin:/root/.local/bin:$PATH"
RUN wget https://downloads.haskell.org/~cabal/cabal-install-${CABAL_VERSION}/cabal-install-${CABAL_VERSION}-$(uname -m)-linux-deb10.tar.xz \
&& tar -xf cabal-install-${CABAL_VERSION}-$(uname -m)-linux-deb10.tar.xz \
&& rm cabal-install-${CABAL_VERSION}-$(uname -m)-linux-deb10.tar.xz \
&& mkdir -p ~/.local/bin \
&& mv cabal ~/.local/bin/ \
&& cabal update && cabal --version
# Libsodium
RUN git clone https://github.com/input-output-hk/libsodium && \
cd libsodium && \
git checkout ${LIBSODIUM_REF} && \
./autogen.sh && \
./configure && \
make && \
make install
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
# secp256k1
RUN git clone https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
git checkout ${SECP256K1_REF} && \
./autogen.sh && \
./configure --enable-module-schnorrsig --enable-experimental && \
make && \
make install
# BLST
COPY libblst.pc /usr/local/lib/pkgconfig/
RUN git clone https://github.com/supranational/blst && \
cd blst && \
git checkout ${BLST_REF} && \
./build.sh && \
cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ && \
cp libblst.a /usr/local/lib/ && \
chmod u=rw,go=r /usr/local/lib/pkgconfig/libblst.pc \
/usr/local/include/blst_aux.h /usr/local/include/blst.h /usr/local/include/blst.hpp \
/usr/local/lib/libblst.a
FROM builder as haskell