-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.base
More file actions
86 lines (76 loc) · 2.21 KB
/
Copy pathDockerfile.base
File metadata and controls
86 lines (76 loc) · 2.21 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
# syntax=docker/dockerfile:1.4
# Shared builder image for all cardano-toa services.
FROM --platform=$TARGETPLATFORM benz0li/ghc-musl:9.6.6 AS builder
# Base toolchain and common libs
RUN apk add bash curl ca-certificates git pkgconfig build-base \
automake autoconf libtool gmp-dev zlib-dev musl-dev musl-utils
# Cardano deps (+ libpq for atlas-cardano → postgresql-libpq pkg-config)
RUN apk add \
curl \
ca-certificates \
automake \
build-base \
pkgconfig \
postgresql-dev \
libffi-dev \
gmp-dev \
lmdb-dev \
numactl-dev \
openssl-dev \
ncurses-dev \
llvm-dev \
zlib-dev \
xz-dev \
xz-libs \
sqlite-dev \
m4 \
git \
jq \
wget \
tmux \
g++ \
make \
autoconf \
libtool
RUN apk add \
ncurses-libs \
libsodium \
libsecp256k1 \
libstdc++ \
gmp \
libgcc
# Build and install libsodium 1.0.19 (for libsodium.so.26)
RUN curl -LO https://download.libsodium.org/libsodium/releases/libsodium-1.0.19.tar.gz && \
tar xvf libsodium-1.0.19.tar.gz && \
cd libsodium-stable && \
./configure --prefix=/usr --enable-shared --disable-static && \
make && make install
# Build and install secp256k1 (schnorr)
RUN git clone --depth 1 --branch 'v0.3.2' https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
./autogen.sh && \
./configure --enable-module-schnorrsig --enable-experimental && \
make && \
make check && \
make install
# BLST
ARG BLST_REF=v0.3.15
COPY libblst.pc /usr/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/include/ && \
cp libblst.a /usr/lib/ && \
chmod u=rw,go=r /usr/lib/pkgconfig/libblst.pc \
/usr/include/blst_aux.h /usr/include/blst.h /usr/include/blst.hpp \
/usr/lib/libblst.a
# Build workspace
WORKDIR /cardano-toa
ENV PATH="/root/.cabal/bin:$PATH"
ENV CC=musl-gcc
ENV LD=musl-gcc
# Prime cabal — dependency cache layer (stable unless .cabal/freeze change)
COPY cardano-toa.cabal cabal.project cabal.project.freeze ./
RUN cabal update
RUN cabal build --only-dependencies --enable-tests