-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.runtime-base
More file actions
56 lines (50 loc) · 1.86 KB
/
Copy pathDockerfile.runtime-base
File metadata and controls
56 lines (50 loc) · 1.86 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
# syntax=docker/dockerfile:1.4
# Shared runtime base for all cardano-toa services (statically-linked binaries).
# Only runtime essentials — no build toolchain.
FROM --platform=$TARGETPLATFORM alpine:3.20
RUN apk add --no-cache \
bash \
curl \
ca-certificates \
ncurses-libs \
libsodium \
libsecp256k1 \
libstdc++ \
gmp \
libgcc \
xz-libs \
postgresql-libs
# libsodium 1.0.19 (for libsodium.so.26)
RUN apk add --no-cache --virtual .build-deps \
build-base curl autoconf automake libtool && \
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 && \
cd / && rm -rf libsodium-stable libsodium-1.0.19.tar.gz
# secp256k1 (schnorr)
RUN apk add --no-cache --virtual .secp-deps \
build-base git autoconf automake libtool && \
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 && \
cd / && rm -rf secp256k1
# BLST
ARG BLST_REF=v0.3.15
COPY libblst.pc /usr/lib/pkgconfig/
RUN apk add --no-cache --virtual .blst-deps build-base git && \
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 && \
cd / && rm -rf blst
# Clean up all build deps
RUN apk del .build-deps .secp-deps .blst-deps 2>/dev/null || true