Skip to content

Commit 0cc231b

Browse files
committed
29: add bitcoind v29.0rc3
1 parent d60bb4d commit 0cc231b

File tree

5 files changed

+272
-0
lines changed

5 files changed

+272
-0
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
strategy:
99
matrix:
1010
version:
11+
- '29'
12+
- '29/alpine'
1113
- '28'
1214
- '28/alpine'
1315
- '27'

29/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM debian:bookworm-slim
2+
3+
ARG UID=101
4+
ARG GID=101
5+
6+
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
7+
maintainer.1="Pedro Branco (@pedrobranco)" \
8+
maintainer.2="Rui Marinho (@ruimarinho)"
9+
10+
RUN groupadd --gid ${GID} bitcoin \
11+
&& useradd --create-home --no-log-init -u ${UID} -g ${GID} bitcoin \
12+
&& apt-get update -y \
13+
&& apt-get install -y curl gnupg gosu \
14+
&& apt-get clean \
15+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
16+
17+
# Special variables just for release candidates, both should be empty for stable
18+
# releases.
19+
ENV RC=rc3
20+
ENV RC_DIR=test.${RC}/
21+
22+
ARG TARGETPLATFORM
23+
ENV BITCOIN_VERSION=29.0
24+
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
25+
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}${RC}/bin:$PATH
26+
27+
RUN set -ex \
28+
&& if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi \
29+
&& if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi \
30+
&& if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi \
31+
&& for key in \
32+
101598DC823C1B5F9A6624ABA5E0907A0380E6C3 \
33+
6A8F9C266528E25AEB1D7731C2371D91CB716EA7 \
34+
2840EAABF4BC9F0FFD716AFAFBAFCC46DE2D3FE2 \
35+
E86AE73439625BBEE306AAE6B66D427F873CB1A3 \
36+
A0083660F235A27000CD3C81CE6EC49945C17EA6 \
37+
F19F5FF2B0589EC341220045BA03F4DBE0C63FB4 \
38+
637DB1E23370F84AFF88CCE03152347D07DA627C \
39+
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
40+
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
41+
152812300785C96444D3334D17565732E08E5E41 \
42+
C388F6961FB972A95678E327F62711DBDCA8AE56 \
43+
9DEAE0DC7063249FB05474681E4AED62986CD25D \
44+
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
45+
F4FC70F07310028424EFC20A8E4256593F177720 \
46+
E61773CD6E01040E2F1BD78CE7E2984B6289C93A \
47+
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
48+
; do \
49+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
50+
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
51+
gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \
52+
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
53+
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
54+
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
55+
done \
56+
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}bitcoin-${BITCOIN_VERSION}${RC}-${TARGETPLATFORM}.tar.gz \
57+
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}SHA256SUMS \
58+
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}SHA256SUMS.asc \
59+
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
60+
&& grep " bitcoin-${BITCOIN_VERSION}${RC}-${TARGETPLATFORM}.tar.gz" SHA256SUMS | sha256sum -c - \
61+
&& tar -xzf *.tar.gz -C /opt \
62+
&& rm *.tar.gz *.asc \
63+
&& rm -rf /opt/bitcoin-${BITCOIN_VERSION}${RC}/bin/bitcoin-qt
64+
65+
COPY docker-entrypoint.sh /entrypoint.sh
66+
67+
VOLUME ["/home/bitcoin/.bitcoin"]
68+
69+
EXPOSE 8332 8333 18332 18333 18443 18444 38333 38332
70+
71+
ENTRYPOINT ["/entrypoint.sh"]
72+
73+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${BITCOIN_VERSION}"
74+
75+
CMD ["bitcoind"]

29/alpine/Dockerfile

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Build stage for Bitcoin Core
2+
FROM alpine as bitcoin-core
3+
4+
ENV GNUPGHOME=/tmp/gnupg
5+
6+
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
7+
RUN apk --no-cache add cmake
8+
RUN apk --no-cache add boost-dev
9+
RUN apk --no-cache add build-base
10+
RUN apk --no-cache add chrpath
11+
RUN apk --no-cache add file
12+
RUN apk --no-cache add gnupg
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
19+
RUN mkdir -p ${GNUPGHOME}
20+
RUN set -ex \
21+
&& for key in \
22+
101598DC823C1B5F9A6624ABA5E0907A0380E6C3 \
23+
6A8F9C266528E25AEB1D7731C2371D91CB716EA7 \
24+
2840EAABF4BC9F0FFD716AFAFBAFCC46DE2D3FE2 \
25+
E86AE73439625BBEE306AAE6B66D427F873CB1A3 \
26+
A0083660F235A27000CD3C81CE6EC49945C17EA6 \
27+
F19F5FF2B0589EC341220045BA03F4DBE0C63FB4 \
28+
637DB1E23370F84AFF88CCE03152347D07DA627C \
29+
ED9BDF7AD6A55E232E84524257FF9BDBCC301009 \
30+
CFB16E21C950F67FA95E558F2EEB9F5CC09526C1 \
31+
152812300785C96444D3334D17565732E08E5E41 \
32+
C388F6961FB972A95678E327F62711DBDCA8AE56 \
33+
9DEAE0DC7063249FB05474681E4AED62986CD25D \
34+
D1DBF2C4B96F2DEBF4C16654410108112E7EA81F \
35+
F4FC70F07310028424EFC20A8E4256593F177720 \
36+
E61773CD6E01040E2F1BD78CE7E2984B6289C93A \
37+
9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \
38+
; do \
39+
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" || \
40+
gpg --batch --keyserver keys.openpgp.org --recv-keys "$key" || \
41+
gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \
42+
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" || \
43+
gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ; \
44+
done
45+
46+
# Special variables just for release candidates, both should be empty for stable
47+
# releases.
48+
ENV RC=rc3
49+
ENV RC_DIR=test.${RC}/
50+
51+
ENV BITCOIN_VERSION=29.0
52+
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}${RC}
53+
54+
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}SHA256SUMS
55+
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}SHA256SUMS.asc
56+
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/${RC_DIR}bitcoin-${BITCOIN_VERSION}${RC}.tar.gz
57+
RUN gpg --verify SHA256SUMS.asc SHA256SUMS
58+
RUN grep " bitcoin-${BITCOIN_VERSION}${RC}.tar.gz\$" SHA256SUMS | sha256sum -c -
59+
RUN tar -xzf *.tar.gz
60+
61+
WORKDIR /bitcoin-${BITCOIN_VERSION}${RC}
62+
63+
RUN cmake -B build \
64+
-DWITH_QRENCODE=OFF \
65+
-DBUILD_TESTS=OFF \
66+
-DWITH_ZMQ=ON \
67+
-DCMAKE_INSTALL_PREFIX=${BITCOIN_PREFIX}
68+
RUN cmake --build build -j4
69+
RUN cmake --install build
70+
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
71+
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
72+
73+
# Build stage for compiled artifacts
74+
FROM alpine
75+
76+
ARG UID=100
77+
ARG GID=101
78+
79+
LABEL maintainer.0="João Fonseca (@joaopaulofonseca)" \
80+
maintainer.1="Pedro Branco (@pedrobranco)" \
81+
maintainer.2="Rui Marinho (@ruimarinho)"
82+
83+
RUN addgroup bitcoin --gid ${GID} --system
84+
RUN adduser --uid ${UID} --system bitcoin --ingroup bitcoin
85+
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
86+
RUN apk --no-cache add \
87+
boost-filesystem \
88+
boost-system \
89+
boost-thread \
90+
libevent \
91+
libzmq \
92+
shadow \
93+
sqlite-dev \
94+
su-exec
95+
96+
# Special variables just for release candidates, both should be empty for stable
97+
# releases.
98+
ENV RC=rc3
99+
ENV RC_DIR=test.${RC}/
100+
101+
ENV BITCOIN_DATA=/home/bitcoin/.bitcoin
102+
ENV BITCOIN_VERSION=29.0
103+
ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}${RC}
104+
ENV PATH=${BITCOIN_PREFIX}/bin:$PATH
105+
106+
COPY --from=bitcoin-core /opt /opt
107+
COPY docker-entrypoint.sh /entrypoint.sh
108+
109+
VOLUME ["/home/bitcoin/.bitcoin"]
110+
111+
EXPOSE 8332 8333 18332 18333 18444
112+
113+
ENTRYPOINT ["/entrypoint.sh"]
114+
115+
RUN bitcoind -version | grep "Bitcoin Core daemon version v${BITCOIN_VERSION}"
116+
117+
CMD ["bitcoind"]

29/alpine/docker-entrypoint.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
5+
usermod -u "$UID" bitcoin
6+
fi
7+
8+
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
9+
groupmod -g "$GID" bitcoin
10+
fi
11+
12+
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
13+
14+
if [ $(echo "$1" | cut -c1) = "-" ]; then
15+
echo "$0: assuming arguments for bitcoind"
16+
17+
set -- bitcoind "$@"
18+
fi
19+
20+
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
21+
mkdir -p "$BITCOIN_DATA"
22+
chmod 700 "$BITCOIN_DATA"
23+
# Fix permissions for home dir.
24+
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
25+
# Fix permissions for bitcoin data dir.
26+
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
27+
28+
echo "$0: setting data directory to $BITCOIN_DATA"
29+
30+
set -- "$@" -datadir="$BITCOIN_DATA"
31+
fi
32+
33+
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
34+
echo
35+
exec su-exec bitcoin "$@"
36+
fi
37+
38+
echo
39+
exec "$@"

29/docker-entrypoint.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -n "${UID+x}" ] && [ "${UID}" != "0" ]; then
5+
usermod -u "$UID" bitcoin
6+
fi
7+
8+
if [ -n "${GID+x}" ] && [ "${GID}" != "0" ]; then
9+
groupmod -g "$GID" bitcoin
10+
fi
11+
12+
echo "$0: assuming uid:gid for bitcoin:bitcoin of $(id -u bitcoin):$(id -g bitcoin)"
13+
14+
if [ $(echo "$1" | cut -c1) = "-" ]; then
15+
echo "$0: assuming arguments for bitcoind"
16+
17+
set -- bitcoind "$@"
18+
fi
19+
20+
if [ $(echo "$1" | cut -c1) = "-" ] || [ "$1" = "bitcoind" ]; then
21+
mkdir -p "$BITCOIN_DATA"
22+
chmod 700 "$BITCOIN_DATA"
23+
# Fix permissions for home dir.
24+
chown -R bitcoin:bitcoin "$(getent passwd bitcoin | cut -d: -f6)"
25+
# Fix permissions for bitcoin data dir.
26+
chown -R bitcoin:bitcoin "$BITCOIN_DATA"
27+
28+
echo "$0: setting data directory to $BITCOIN_DATA"
29+
30+
set -- "$@" -datadir="$BITCOIN_DATA"
31+
fi
32+
33+
if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
34+
echo
35+
exec gosu bitcoin "$@"
36+
fi
37+
38+
echo
39+
exec "$@"

0 commit comments

Comments
 (0)