54 lines
1.2 KiB
Docker
54 lines
1.2 KiB
Docker
# Alpine-based MUSL static builder image for nt.
|
|
# Used by build.sh to compile a fully static ./nt inside Docker.
|
|
|
|
FROM alpine:3.19 AS builder
|
|
|
|
RUN apk add --no-cache \
|
|
bash \
|
|
build-base \
|
|
musl-dev \
|
|
git \
|
|
pkgconfig \
|
|
ccache \
|
|
autoconf \
|
|
automake \
|
|
libtool \
|
|
openssl-dev \
|
|
openssl-libs-static \
|
|
zlib-dev \
|
|
zlib-static \
|
|
curl-dev \
|
|
curl-static \
|
|
sqlite-dev \
|
|
sqlite-static \
|
|
linux-headers \
|
|
nghttp2-dev \
|
|
nghttp2-static \
|
|
brotli-static \
|
|
c-ares-static \
|
|
libidn2-static \
|
|
libpsl-static \
|
|
libunistring-static \
|
|
ncurses-dev \
|
|
ncurses-static
|
|
|
|
WORKDIR /build
|
|
|
|
# Build static libsecp256k1
|
|
RUN cd /tmp && \
|
|
git clone --depth 1 https://github.com/bitcoin-core/secp256k1.git && \
|
|
cd secp256k1 && \
|
|
./autogen.sh && \
|
|
./configure --enable-static --disable-shared --prefix=/usr CFLAGS="-fPIC" && \
|
|
make -j$(nproc) && \
|
|
make install && \
|
|
rm -rf /tmp/secp256k1
|
|
|
|
# Project sources
|
|
COPY . /build/
|
|
|
|
# Image is used by build.sh as a static build environment.
|
|
# Binary compilation happens in a docker run with mounted source + ccache.
|
|
|
|
# Keep builder as the final stage so docker run has full toolchain.
|