Skip to content

Commit a3336f3

Browse files
authored
Merge pull request #74 from willcl-ark/v29.3
2 parents 6ceade8 + b51ce54 commit a3336f3

File tree

13 files changed

+255
-7
lines changed

13 files changed

+255
-7
lines changed

29.3/Dockerfile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM debian:bookworm-slim AS builder
2+
3+
LABEL maintainer.0="Will Clark (@willcl-ark)"
4+
5+
RUN apt-get update -y \
6+
&& apt-get install -y ca-certificates curl git gnupg gosu python3 wget --no-install-recommends \
7+
&& apt-get clean \
8+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
9+
10+
ARG TARGETPLATFORM
11+
ENV BITCOIN_VERSION=29.3
12+
ENV SIGS_REPO_URL="https://github.com/bitcoin-core/guix.sigs.git"
13+
ENV SIGS_CLONE_DIR="guix.sigs"
14+
ENV VERIFY_SCRIPT_URL="https://raw.githubusercontent.com/bitcoin/bitcoin/v${BITCOIN_VERSION}/contrib/verify-binaries/verify.py"
15+
ENV TMPDIR="/tmp/bitcoin_verify_binaries"
16+
17+
RUN set -ex \
18+
&& if echo $BITCOIN_VERSION | grep -q "rc" ; then \
19+
VERIFY_VERSION=$(echo $BITCOIN_VERSION | sed 's/\(.*\)rc\([0-9]*\)/\1-rc\2/'); \
20+
else \
21+
VERIFY_VERSION=$BITCOIN_VERSION; \
22+
fi \
23+
&& echo "$VERIFY_VERSION" \
24+
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
25+
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
26+
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
27+
&& git clone ${SIGS_REPO_URL} ${SIGS_CLONE_DIR} \
28+
&& gpg --import "${SIGS_CLONE_DIR}"/builder-keys/* \
29+
&& curl -o verify.py ${VERIFY_SCRIPT_URL} \
30+
&& chmod +x verify.py \
31+
&& ./verify.py \
32+
--min-good-sigs 6 pub "${VERIFY_VERSION}-linux" \
33+
&& tar -xzf "${TMPDIR}.${VERIFY_VERSION}-linux/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz" -C /opt \
34+
&& rm -rf ${SIGS_CLONE_DIR} \
35+
&& rm -rf ${TMPDIR} \
36+
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
37+
38+
# Second stage
39+
FROM debian:bookworm-slim
40+
41+
ARG UID=101
42+
ARG GID=101
43+
44+
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
45+
ENV BITCOIN_VERSION=29.3
46+
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH
47+
48+
RUN groupadd --gid ${GID} bitcoin \
49+
&& if echo "$BITCOIN_VERSION" | grep -q "rc"; then \
50+
PADDED_VERSION=$(echo $BITCOIN_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)rc/\1.\2.0rc/'); \
51+
else \
52+
PADDED_VERSION=$BITCOIN_VERSION; \
53+
fi \
54+
&& echo "Padded version: $PADDED_VERSION" \
55+
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
56+
&& apt-get update -y \
57+
&& apt-get install -y gosu --no-install-recommends \
58+
&& apt-get clean \
59+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
60+
61+
COPY --from=builder /opt/bitcoin-${BITCOIN_VERSION} /opt/bitcoin-${BITCOIN_VERSION}
62+
63+
COPY docker-entrypoint.sh /entrypoint.sh
64+
65+
VOLUME ["/home/bitcoin/.bitcoin"]
66+
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
67+
68+
ENTRYPOINT ["/entrypoint.sh"]
69+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${PADDED_VERSION}"
70+
CMD ["bitcoind"]

29.3/alpine/Dockerfile

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Build stage for Bitcoin Core
2+
FROM alpine:3.23 AS build
3+
4+
RUN apk --no-cache add \
5+
boost-dev \
6+
build-base \
7+
ccache \
8+
chrpath \
9+
clang20 \
10+
cmake \
11+
file \
12+
gnupg \
13+
git \
14+
libevent-dev \
15+
libtool \
16+
linux-headers \
17+
sqlite-dev \
18+
zeromq-dev
19+
20+
ENV BITCOIN_VERSION=29.3
21+
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
22+
ENV BITCOIN_SOURCE_DIR=/bitcoin/src
23+
ENV SIGS_REPO_URL="https://github.com/bitcoin-core/guix.sigs.git"
24+
ENV SIGS_CLONE_DIR="guix.sigs"
25+
ENV VERIFY_SCRIPT_URL="https://raw.githubusercontent.com/bitcoin/bitcoin/v${BITCOIN_VERSION}/contrib/verify-binaries/verify.py"
26+
27+
WORKDIR /bitcoin
28+
29+
RUN set -ex \
30+
&& if echo $BITCOIN_VERSION | grep -q "rc" ; then \
31+
VERIFY_VERSION=$(echo $BITCOIN_VERSION | sed 's/\(.*\)rc\([0-9]*\)/\1-rc\2/'); \
32+
ADDRESS="https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION%%rc*}/test.rc${BITCOIN_VERSION##*rc}"; \
33+
else \
34+
VERIFY_VERSION=$BITCOIN_VERSION; \
35+
ADDRESS="https://bitcoincore.org/bin/bitcoin-core-${VERIFY_VERSION}"; \
36+
fi \
37+
&& echo "$VERIFY_VERSION" \
38+
&& wget ${ADDRESS}/bitcoin-${BITCOIN_VERSION}.tar.gz \
39+
&& wget ${ADDRESS}/SHA256SUMS \
40+
&& wget ${ADDRESS}/SHA256SUMS.asc \
41+
&& git clone ${SIGS_REPO_URL} ${SIGS_CLONE_DIR} \
42+
&& gpg --import "${SIGS_CLONE_DIR}"/builder-keys/* \
43+
&& wget -O verify.py ${VERIFY_SCRIPT_URL} \
44+
&& chmod +x verify.py \
45+
&& ./verify.py bin SHA256SUMS \
46+
"bitcoin-${BITCOIN_VERSION}.tar.gz" \
47+
&& mkdir -p ${BITCOIN_SOURCE_DIR} \
48+
&& tar -xzf "bitcoin-${BITCOIN_VERSION}.tar.gz" -C ${BITCOIN_SOURCE_DIR} \
49+
&& rm -rf ${SIGS_CLONE_DIR}
50+
51+
WORKDIR "${BITCOIN_SOURCE_DIR}/bitcoin-${BITCOIN_VERSION}"
52+
53+
RUN cmake -B build \
54+
-DBUILD_TESTS=OFF \
55+
-DBUILD_TX=ON \
56+
-DBUILD_UTIL=OFF \
57+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
58+
-DCMAKE_CXX_COMPILER=clang++-20 \
59+
-DCMAKE_C_COMPILER=clang-20 \
60+
-DCMAKE_INSTALL_PREFIX:PATH="${BITCOIN_PREFIX}" \
61+
-DWITH_CCACHE=ON && \
62+
cmake --build build -j$(nproc) && \
63+
strip build/bin/bitcoin-cli build/bin/bitcoin-tx build/bin/bitcoind && \
64+
cmake --install build
65+
66+
# Build stage for compiled artifacts
67+
FROM alpine:3.23
68+
69+
ARG UID=100
70+
ARG GID=101
71+
72+
LABEL maintainer.0="Will Clark (@willcl-ark)"
73+
74+
RUN addgroup bitcoin --gid ${GID} --system
75+
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
76+
RUN apk --no-cache add \
77+
libevent \
78+
libzmq \
79+
shadow \
80+
sqlite-libs \
81+
su-exec
82+
83+
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
84+
ENV BITCOIN_VERSION=29.3
85+
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
86+
ENV PATH=/opt/bin:$PATH
87+
88+
COPY --from=build ${BITCOIN_PREFIX} /opt
89+
COPY docker-entrypoint.sh /entrypoint.sh
90+
91+
RUN if echo "$BITCOIN_VERSION" | grep -q "rc"; then \
92+
PADDED_VERSION=$(echo $BITCOIN_VERSION | sed 's/\([0-9]\+\)\.\([0-9]\+\)rc/\1.\2.0rc/'); \
93+
else \
94+
PADDED_VERSION=$BITCOIN_VERSION; \
95+
fi
96+
97+
VOLUME ["/home/bitcoin/.bitcoin"]
98+
99+
EXPOSE 8332 8333 18332 18333 18444
100+
101+
ENTRYPOINT ["/entrypoint.sh"]
102+
103+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${PADDED_VERSION}"
104+
105+
CMD ["bitcoind"]

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,15 @@
2929
- `30.2`, `30`, `latest` ([30.2/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/30.2/Dockerfile)) [**multi-platform**]
3030
- `30.2-alpine`, `30-alpine`, `alpine` ([30.2/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/30.2/alpine/Dockerfile))
3131

32-
- `29.2`, `29` ([29.2/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.2/Dockerfile)) [**multi-platform**]
33-
- `29.2-alpine`, `29-alpine` ([29.2/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.2/alpine/Dockerfile))
32+
- `29.3`, `29` ([29.3/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.3/Dockerfile)) [**multi-platform**]
33+
- `29.3-alpine`, `29-alpine` ([29.3/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.3/alpine/Dockerfile))
3434

3535
- `28.3`, `28` ([28.3/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/28.3/Dockerfile)) [**multi-platform**]
3636
- `28.3-alpine`, `28-alpine` ([28.3/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/28.3/alpine/Dockerfile))
3737

3838
- `27.2`, `27` ([27.2/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/27.2/Dockerfile)) [**multi-platform**]
3939
- `27.2-alpine`, `27-alpine` ([27.2/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/27.2/alpine/Dockerfile))
4040

41-
## Release Candidates
42-
43-
- `29.3rc2` ([29.3rc2/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.3rc2/Dockerfile)) [**multi-platform**]
44-
- `29.3rc2-alpine`([29.3rc2/alpine/Dockerfile](https://github.com/willcl-ark/bitcoin-core-docker/blob/master/29.3rc2/alpine/Dockerfile))
45-
4641
### Picking the right tag
4742

4843
> [!IMPORTANT]
File renamed without changes.

0 commit comments

Comments
 (0)