Skip to content

Commit 5bd2641

Browse files
committed
fix: use cmake build bitcoin core 29
1 parent c05a8ca commit 5bd2641

File tree

2 files changed

+39
-34
lines changed

2 files changed

+39
-34
lines changed

.github/workflows/bitcoin_core.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
context: "./28/debian"
4646
- name: 28-ubuntu
4747
context: "./28/ubuntu"
48-
#- name: 29-alpine
49-
# context: "./29/alpine"
48+
- name: 29-alpine
49+
context: "./29/alpine"
5050
#- name: 29-debian
5151
# context: "./29/debian"
5252
#- name: 29-ubuntu

29/alpine/Dockerfile

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
FROM alpine:3.21 as bitcoin-core
33

44
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
5-
RUN apk --no-cache add autoconf
6-
RUN apk --no-cache add automake
7-
RUN apk --no-cache add boost-dev
8-
RUN apk --no-cache add build-base
9-
RUN apk --no-cache add chrpath
10-
RUN apk --no-cache add file
11-
RUN apk --no-cache add gnupg
12-
RUN apk --no-cache add git
13-
RUN apk --no-cache add libevent-dev
14-
RUN apk --no-cache add libressl
15-
RUN apk --no-cache add libtool
16-
RUN apk --no-cache add linux-headers
17-
RUN apk --no-cache add sqlite-dev
18-
RUN apk --no-cache add zeromq-dev
5+
RUN apk --no-cache add \
6+
boost-dev \
7+
build-base \
8+
ccache \
9+
chrpath \
10+
clang18 \
11+
cmake \
12+
file \
13+
gnupg \
14+
git \
15+
libevent-dev \
16+
libressl \
17+
libtool \
18+
linux-headers \
19+
sqlite-dev \
20+
zeromq-dev
1921

2022
ENV BITCOIN_VERSION=29.0
2123
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
@@ -41,24 +43,27 @@ RUN set -ex \
4143

4244
WORKDIR "${BITCOIN_SOURCE_DIR}/bitcoin-${BITCOIN_VERSION}"
4345

44-
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat/compat.h
45-
RUN ./autogen.sh
46-
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
47-
--prefix=${BITCOIN_PREFIX} \
48-
--mandir=/usr/share/man \
49-
--disable-tests \
50-
--disable-bench \
51-
--disable-ccache \
52-
--with-gui=no \
53-
--with-utils \
54-
--with-libs \
55-
--with-sqlite=yes \
56-
--with-daemon
57-
RUN make -j4
58-
RUN make install
59-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
60-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
61-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
46+
# use cmake build
47+
# https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Autotools-to-CMake-Options-Mapping
48+
49+
RUN cmake -B build \
50+
-DBUILD_TESTS=OFF \
51+
-DBUILD_BENCH=OFF \
52+
-DWITH_CCACHE=ON \
53+
#-DBUILD_GUI=OFF \
54+
-DBUILD_CLI=ON \
55+
-DBUILD_TX=ON \
56+
-DBUILD_UTIL=ON \
57+
-DENABLE_WALLET=ON \
58+
-DBUILD_DAEMON=ON \
59+
# CMAKE VAR
60+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
61+
-DCMAKE_CXX_COMPILER=clang++-18 \
62+
-DCMAKE_C_COMPILER=clang-18 \
63+
-DCMAKE_INSTALL_PREFIX:PATH="${BITCOIN_PREFIX}" && \
64+
cmake --build build -j$(nproc) && \
65+
strip build/bin/bitcoin-cli build/bin/bitcoin-tx build/bin/bitcoind && \
66+
cmake --install build
6267

6368
# Build stage for compiled artifacts
6469
FROM alpine:3.21

0 commit comments

Comments
 (0)