Skip to content

Commit 40b4623

Browse files
committed
fix: use cmake build bitcoin core 29
bitcoin -version output Bitcoin Core daemon version v29.0.0
1 parent 8733036 commit 40b4623

File tree

4 files changed

+35
-31
lines changed

4 files changed

+35
-31
lines changed

.github/workflows/bitcoin_core.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ jobs:
4545
context: "./28/debian"
4646
- name: 28-ubuntu
4747
context: "./28/ubuntu"
48-
- name: 29-alpine
49-
context: "./29/alpine"
50-
- name: 29-debian
51-
context: "./29/debian"
52-
- name: 29-ubuntu
53-
context: "./29/ubuntu"
54-
- name: latest
55-
context: "./29/alpine"
48+
#- name: 29-alpine
49+
# context: "./29/alpine"
50+
#- name: 29-debian
51+
# context: "./29/debian"
52+
#- name: 29-ubuntu
53+
# context: "./29/ubuntu"
54+
#- name: latest
55+
# context: "./29/alpine"
5656
steps:
5757
- name: Checkout
5858
uses: actions/checkout@v4

29/alpine/Dockerfile

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
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
5+
RUN apk --no-cache add ccache
6+
RUN apk --no-cache add cmake
7+
RUN apk --no-cache add clang18
78
RUN apk --no-cache add boost-dev
89
RUN apk --no-cache add build-base
910
RUN apk --no-cache add chrpath
@@ -41,24 +42,27 @@ RUN set -ex \
4142

4243
WORKDIR "${BITCOIN_SOURCE_DIR}/bitcoin-${BITCOIN_VERSION}"
4344

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
45+
# use cmake build
46+
# https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Autotools-to-CMake-Options-Mapping
47+
48+
RUN cmake -B build \
49+
-DBUILD_TESTS=OFF \
50+
-DBUILD_BENCH=OFF \
51+
-DWITH_CCACHE=ON \
52+
-DBUILD_GUI=OFF \
53+
-DBUILD_CLI=ON \
54+
-DBUILD_TX=ON \
55+
-DBUILD_UTIL=ON \
56+
-DENABLE_WALLET=ON \
57+
-DBUILD_DAEMON=ON \
58+
# CMAKE VAR
59+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
60+
-DCMAKE_CXX_COMPILER=clang++-18 \
61+
-DCMAKE_C_COMPILER=clang-18 \
62+
-DCMAKE_INSTALL_PREFIX:PATH="${BITCOIN_PREFIX}" && \
63+
cmake --build build -j$(nproc) && \
64+
strip build/bin/bitcoin-cli build/bin/bitcoin-tx build/bin/bitcoind && \
65+
cmake --install build
6266

6367
# Build stage for compiled artifacts
6468
FROM alpine:3.21
@@ -97,6 +101,6 @@ EXPOSE 8332 8333 18332 18333 18444
97101

98102
ENTRYPOINT ["/entrypoint.sh"]
99103

100-
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
104+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${BITCOIN_VERSION}"
101105

102106
CMD ["bitcoind"]

29/debian/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ VOLUME ["/home/bitcoin/.bitcoin"]
5959
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
6060

6161
ENTRYPOINT ["/entrypoint.sh"]
62-
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
62+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${BITCOIN_VERSION}"
6363
CMD ["bitcoind"]

29/ubuntu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ VOLUME ["/home/bitcoin/.bitcoin"]
6060
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
6161

6262
ENTRYPOINT ["/entrypoint.sh"]
63-
RUN bitcoind -version | grep "Bitcoin Core version v${BITCOIN_VERSION}"
63+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${BITCOIN_VERSION}"
6464
CMD ["bitcoind"]

0 commit comments

Comments
 (0)