Compare commits
210 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
305faa8433 | ||
|
|
9df1db12c0 | ||
|
|
d28264a622 | ||
|
|
6c67542b23 | ||
|
|
381d85d793 | ||
|
|
bb0a88b66a | ||
|
|
2435d63f51 | ||
|
|
a1a2ba2e28 | ||
|
|
d0534b03b8 | ||
|
|
11428fe3eb | ||
|
|
14f5f26c02 | ||
|
|
e90f70ebb0 | ||
|
|
793588649e | ||
|
|
f7a7588b0a | ||
|
|
904410dc59 | ||
|
|
00c6a8ce08 | ||
|
|
ea1bde2d61 | ||
|
|
d454be3303 | ||
|
|
bc294baba0 | ||
|
|
7b91acc98d | ||
|
|
99f91c904c | ||
|
|
0a741bfada | ||
|
|
d71da49ed7 | ||
|
|
dd2c60bb48 | ||
|
|
0ff36e1f99 | ||
|
|
4a12df443c | ||
|
|
b32831e139 | ||
|
|
5335925f08 | ||
|
|
77eab37b4c | ||
|
|
9f48249556 | ||
|
|
8a86961249 | ||
|
|
f06f70fb7b | ||
|
|
2193093a8e | ||
|
|
df0330af26 | ||
|
|
f09a468d22 | ||
|
|
6c81f9ffcc | ||
|
|
9b761054fc | ||
|
|
10116f1425 | ||
|
|
fdf8652acf | ||
|
|
f10560cc99 | ||
|
|
9f94561f10 | ||
|
|
f25a568d28 | ||
|
|
5c31ce13f9 | ||
|
|
8041af90a1 | ||
|
|
c33c22f379 | ||
|
|
7df19fa96d | ||
|
|
b230597fdd | ||
|
|
1ac53a386d | ||
|
|
b70a4ddce6 | ||
|
|
3292b58f0c | ||
|
|
f7aa4d3c4d | ||
|
|
48e1dc3bc2 | ||
|
|
dd6806455b | ||
|
|
52560eecaa | ||
|
|
7c662416fe | ||
|
|
1db6f05deb | ||
|
|
d4ca296a74 | ||
|
|
4ce51ae817 | ||
|
|
121a5be1bf | ||
|
|
342c5fc284 | ||
|
|
3043eb8c83 | ||
|
|
0348d02c92 | ||
|
|
9575cd7919 | ||
|
|
ade0537904 | ||
|
|
9c8f03c8ed | ||
|
|
7e84d381ec | ||
|
|
6239fa766f | ||
|
|
87006ce83a | ||
|
|
aa2080e93e | ||
|
|
6eddd2b012 | ||
|
|
a2ec4204dc | ||
|
|
dd477e145a | ||
|
|
de2c24f00b | ||
|
|
09a88a6a55 | ||
|
|
ed01648531 | ||
|
|
1046984f08 | ||
|
|
5bc58418c4 | ||
|
|
ae3f9cff0f | ||
|
|
1867c330e1 | ||
|
|
102c66aac6 | ||
|
|
e2800580ae | ||
|
|
0c70767460 | ||
|
|
0c32f6820e | ||
|
|
9f441d226b | ||
|
|
b2be68992f | ||
|
|
f67d00fd58 | ||
|
|
e734c56241 | ||
|
|
8f7b21164c | ||
|
|
6682b712a5 | ||
|
|
e2fb4e0120 | ||
|
|
14a4ee06f7 | ||
|
|
7b70e37dac | ||
|
|
3ef61828be | ||
|
|
49e7911bae | ||
|
|
a294aa9140 | ||
|
|
8b00752818 | ||
|
|
cf9ff09932 | ||
|
|
3f29178794 | ||
|
|
55b7c7f477 | ||
|
|
d9089aa7ca | ||
|
|
d25a0ecd08 | ||
|
|
7101a80c2c | ||
|
|
24d3cf5c72 | ||
|
|
6c1b1f252e | ||
|
|
6340c057b0 | ||
|
|
257c5ab491 | ||
|
|
071e824563 | ||
|
|
32d53d56f8 | ||
|
|
d740fd085c | ||
|
|
de5baa3fca | ||
|
|
596dd76375 | ||
|
|
1052e9ddd5 | ||
|
|
1d7b2a4190 | ||
|
|
2c84a00180 | ||
|
|
d26adaceb5 | ||
|
|
3fd9499d4b | ||
|
|
080a2d4660 | ||
|
|
a0afec7e28 | ||
|
|
e4e713ab23 | ||
|
|
1f7001d90b | ||
|
|
3d2a0bf359 | ||
|
|
3d37e81fb4 | ||
|
|
db06f2d941 | ||
|
|
95ae4f1e90 | ||
|
|
669046e7da | ||
|
|
561cb2974b | ||
|
|
4f5251c768 | ||
|
|
370e24aeb4 | ||
|
|
70bfb194d7 | ||
|
|
32e9e6b133 | ||
|
|
2ce5dcfe63 | ||
|
|
d0fce7641e | ||
|
|
314affdc73 | ||
|
|
ba4e9c30c9 | ||
|
|
c94a3ecd0b | ||
|
|
0fba4fb961 | ||
|
|
e2178b4a6d | ||
|
|
fc6889a248 | ||
|
|
e35bea7557 | ||
|
|
c23a68d65f | ||
|
|
9905554613 | ||
|
|
ad7159ea1b | ||
|
|
b99957008e | ||
|
|
9ff62f4e4e | ||
|
|
b7d2029d18 | ||
|
|
a7094681d7 | ||
|
|
06be782f3e | ||
|
|
7d28d1ba11 | ||
|
|
c4d8901fbc | ||
|
|
4520eb1175 | ||
|
|
65d5f02f1b | ||
|
|
1f7cf5d993 | ||
|
|
e0430e2cef | ||
|
|
1b75ac977e | ||
|
|
9c657b3765 | ||
|
|
d02f51ae55 | ||
|
|
7bb2ef36ed | ||
|
|
9a61bece38 | ||
|
|
305e405f99 | ||
|
|
4dd7b1ba54 | ||
|
|
81666e48ee | ||
|
|
6d7e1c5e5b | ||
|
|
c10281b3aa | ||
|
|
038ed8f252 | ||
|
|
be815b7b96 | ||
|
|
5b607a9439 | ||
|
|
55a8efca20 | ||
|
|
e86b4f90ad | ||
|
|
83d4839676 | ||
|
|
063287dbf1 | ||
|
|
e35a88e342 | ||
|
|
9cb99e1e30 | ||
|
|
b07a34ff66 | ||
|
|
4c14ec5efb | ||
|
|
65b70cbf85 | ||
|
|
542f94b0e2 | ||
|
|
d4a1154b03 | ||
|
|
882ab02a8b | ||
|
|
48a2057e5c | ||
|
|
52b4cd10ce | ||
|
|
d991759949 | ||
|
|
dbc285345e | ||
|
|
9ccc1c26ab | ||
|
|
e8f6ecd628 | ||
|
|
ef5dfda841 | ||
|
|
c802bd414f | ||
|
|
83b84dc97b | ||
|
|
8173c45ab7 | ||
|
|
ceec1e1ece | ||
|
|
71b556f880 | ||
|
|
8c8683d029 | ||
|
|
5153b0fb83 | ||
|
|
0d2cc94630 | ||
|
|
993ab79c13 | ||
|
|
55892eadd5 | ||
|
|
923db55876 | ||
|
|
4ba9f9589a | ||
|
|
0053557318 | ||
|
|
5a5313f4bf | ||
|
|
e2be5500e0 | ||
|
|
0089acd8e1 | ||
|
|
87fb8dd63a | ||
|
|
1076b27ac9 | ||
|
|
ece369f053 | ||
|
|
a96f66e876 | ||
|
|
4eb388b722 | ||
|
|
1882d54625 | ||
|
|
4df8202cbd | ||
|
|
a34a4de0fe | ||
|
|
dac9f5af77 |
@ -7,17 +7,39 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
machine:
|
||||
enabled: true
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
|
||||
# publish jobs require $DOCKERHUB_USER, $DOCKERHUB_PASS defined
|
||||
publish_linuxamd64:
|
||||
machine:
|
||||
enabled: true
|
||||
publish_buildx:
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
- run:
|
||||
command: |
|
||||
source ".circleci/parse-tag.sh"
|
||||
DOCKERHUB_DOCKEFILE="$DOCKERHUB_DOCKEFILE_BUILDX"
|
||||
DOCKERHUB_DESTINATION="$DOCKERHUB_REPO:$LATEST_TAG"
|
||||
if [ -f $DOCKERHUB_DOCKEFILE ]; then
|
||||
source ".circleci/push-image-buildx.sh"
|
||||
else
|
||||
echo "Skipping linuxamd64 because $DOCKERHUB_DOCKEFILE_BUILDX is not found"
|
||||
fi
|
||||
|
||||
publish_linuxamd64:
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
- run:
|
||||
command: |
|
||||
source ".circleci/parse-tag.sh"
|
||||
@ -30,10 +52,12 @@ jobs:
|
||||
fi
|
||||
|
||||
publish_linuxarm64v8:
|
||||
machine:
|
||||
enabled: true
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
- run:
|
||||
command: |
|
||||
source ".circleci/parse-tag.sh"
|
||||
@ -42,7 +66,7 @@ jobs:
|
||||
if [ -f $DOCKERHUB_DOCKEFILE ]; then
|
||||
#
|
||||
# Make sure the builder is copy the arm emulator
|
||||
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
sudo docker $DOCKER_OPTIONS run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
sudo apt update
|
||||
sudo apt install -y qemu qemu-user-static qemu-user binfmt-support
|
||||
sudo cp /usr/bin/qemu-aarch64-static "$(dirname "$DOCKERHUB_DOCKEFILE")/qemu-aarch64-static"
|
||||
@ -53,10 +77,12 @@ jobs:
|
||||
echo "Skipping linuxarm64v8 because $DOCKERHUB_DOCKEFILE is not found"
|
||||
fi
|
||||
publish_linuxarm32v7:
|
||||
machine:
|
||||
enabled: true
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
- run:
|
||||
command: |
|
||||
source ".circleci/parse-tag.sh"
|
||||
@ -65,7 +91,7 @@ jobs:
|
||||
if [ -f $DOCKERHUB_DOCKEFILE ]; then
|
||||
#
|
||||
# Make sure the builder is copy the arm emulator
|
||||
sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
sudo docker $DOCKER_OPTIONS run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
if grep "#EnableQEMU" $DOCKERHUB_DOCKEFILE; then
|
||||
sudo apt update
|
||||
sudo apt install -y qemu qemu-user-static qemu-user binfmt-support
|
||||
@ -78,19 +104,17 @@ jobs:
|
||||
echo "Skipping linuxarm32v7 because $DOCKERHUB_DOCKEFILE is not found"
|
||||
fi
|
||||
publish_multiarch:
|
||||
machine:
|
||||
enabled: true
|
||||
image: circleci/classic:201808-01
|
||||
docker:
|
||||
- image: cimg/base:stable
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 20.10.24
|
||||
- run:
|
||||
command: |
|
||||
# Turn on Experimental features
|
||||
sudo mkdir $HOME/.docker
|
||||
sudo sh -c 'echo "{ \"experimental\": \"enabled\" }" >> $HOME/.docker/config.json'
|
||||
source ".circleci/parse-tag.sh"
|
||||
#
|
||||
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
|
||||
sudo docker $DOCKER_OPTIONS login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
|
||||
IMAGES=""
|
||||
if [ -f $DOCKERHUB_DOCKEFILE_AMD64 ]; then
|
||||
IMAGES="$IMAGES $DOCKERHUB_DESTINATION-amd64"
|
||||
@ -106,15 +130,15 @@ jobs:
|
||||
else
|
||||
sudo docker manifest create --amend $DOCKERHUB_DESTINATION $IMAGES
|
||||
if [ -f $DOCKERHUB_DOCKEFILE_AMD64 ]; then
|
||||
sudo docker manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-amd64 --os linux --arch amd64
|
||||
sudo docker $DOCKER_OPTIONS manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-amd64 --os linux --arch amd64
|
||||
fi
|
||||
if [ -f $DOCKERHUB_DOCKEFILE_ARM32 ]; then
|
||||
sudo docker manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-arm32v7 --os linux --arch arm --variant v7
|
||||
sudo docker $DOCKER_OPTIONS manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-arm32v7 --os linux --arch arm --variant v7
|
||||
fi
|
||||
if [ -f $DOCKERHUB_DOCKEFILE_ARM64 ]; then
|
||||
sudo docker manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-arm64v8 --os linux --arch arm64 --variant v8
|
||||
sudo docker $DOCKER_OPTIONS manifest annotate $DOCKERHUB_DESTINATION $DOCKERHUB_DESTINATION-arm64v8 --os linux --arch arm64 --variant v8
|
||||
fi
|
||||
sudo docker manifest push $DOCKERHUB_DESTINATION -p
|
||||
sudo docker $DOCKER_OPTIONS manifest push $DOCKERHUB_DESTINATION -p
|
||||
fi
|
||||
|
||||
workflows:
|
||||
@ -127,29 +151,37 @@ workflows:
|
||||
ignore: /.*/
|
||||
# Example: BitcoinCore/0.17.0 or BitcoinCore/0.17.0-1 or Bitcoin/0.21.0-based-taproot0.1
|
||||
tags:
|
||||
only: /^[^/]+[/][0-9]+(\.[0-9]+)*(-[a-z0-9\.-]+)?/
|
||||
only: /^[^/]+[/]{1}([^/]+)/
|
||||
- publish_linuxarm32v7:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
# Example: BitcoinCore/0.17.0
|
||||
only: /^[^/]+[/][0-9]+(\.[0-9]+)*(-[a-z0-9\.-]+)?/
|
||||
only: /^[^/]+[/]{1}([^/]+)/
|
||||
- publish_linuxarm64v8:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
# Example: BitcoinCore/0.17.0
|
||||
only: /^[^/]+[/][0-9]+(\.[0-9]+)*(-[a-z0-9\.-]+)?/
|
||||
- publish_multiarch:
|
||||
requires:
|
||||
- publish_linuxamd64
|
||||
- publish_linuxarm32v7
|
||||
- publish_linuxarm64v8
|
||||
only: /^[^/]+[/]{1}([^/]+)/
|
||||
- publish_buildx:
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
# Example: BitcoinCore/0.17.0
|
||||
only: /^[^/]+[/][0-9]+(\.[0-9]+)*(-[a-z0-9\.-]+)?/
|
||||
only: /^[^/]+[/]{1}([^/]+)/
|
||||
- publish_multiarch:
|
||||
requires:
|
||||
- publish_linuxamd64
|
||||
- publish_linuxarm32v7
|
||||
- publish_linuxarm64v8
|
||||
- publish_buildx
|
||||
filters:
|
||||
branches:
|
||||
ignore: /.*/
|
||||
tags:
|
||||
# Example: BitcoinCore/0.17.0
|
||||
only: /^[^/]+[/]{1}([^/]+)/
|
||||
|
||||
@ -28,6 +28,9 @@ DOCKERHUB_DESTINATION="$DOCKERHUB_REPO:$LATEST_TAG"
|
||||
DOCKERHUB_DOCKEFILE_ARM64="$NODE_NAME/$NODE_VERSION/linuxarm64v8.Dockerfile"
|
||||
DOCKERHUB_DOCKEFILE_ARM32="$NODE_NAME/$NODE_VERSION/linuxarm32v7.Dockerfile"
|
||||
DOCKERHUB_DOCKEFILE_AMD64="$NODE_NAME/$NODE_VERSION/linuxamd64.Dockerfile"
|
||||
DOCKERHUB_DOCKEFILE_BUILDX="$NODE_NAME/$NODE_VERSION/Dockerfile"
|
||||
DOCKER_OPTIONS="-H=$DOCKER_HOST"
|
||||
|
||||
|
||||
echo "LATEST_TAG=$LATEST_TAG"
|
||||
echo "NODE_VERSION=$NODE_VERSION"
|
||||
|
||||
10
.circleci/push-image-buildx.sh
Normal file
10
.circleci/push-image-buildx.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Pushing $DOCKERHUB_DOCKEFILE to dockerhub repository $DOCKERHUB_DESTINATION"
|
||||
sudo docker $DOCKER_OPTIONS login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
|
||||
sudo docker buildx create --use
|
||||
DOCKER_BUILDX_OPTS="--platform linux/amd64,linux/arm64,linux/arm/v7 --push"
|
||||
sudo docker buildx build $DOCKER_BUILDX_OPTS \
|
||||
-f "$DOCKERHUB_DOCKEFILE" \
|
||||
-t $DOCKERHUB_DESTINATION \
|
||||
"$NODE_NAME/$NODE_VERSION"
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Pushing $DOCKERHUB_DOCKEFILE to dockerhub repository $DOCKERHUB_DESTINATION"
|
||||
sudo docker login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
|
||||
sudo docker build --pull -t $DOCKERHUB_DESTINATION -f "$DOCKERHUB_DOCKEFILE" "$NODE_NAME/$NODE_VERSION"
|
||||
sudo docker push $DOCKERHUB_DESTINATION
|
||||
sudo docker $DOCKER_OPTIONS login --username=$DOCKERHUB_USER --password=$DOCKERHUB_PASS
|
||||
sudo docker $DOCKER_OPTIONS build --pull -t $DOCKERHUB_DESTINATION -f "$DOCKERHUB_DOCKEFILE" "$NODE_NAME/$NODE_VERSION"
|
||||
sudo docker $DOCKER_OPTIONS push $DOCKERHUB_DESTINATION
|
||||
65
Bitcoin/23.0/docker-entrypoint.sh
Executable file
65
Bitcoin/23.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
40
Bitcoin/23.0/linuxamd64.Dockerfile
Normal file
40
Bitcoin/23.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 23.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 2cca490c1f2842884a3c5b0606f179f9f937177da4eadd628e3f7fd7e25d26d0
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
Bitcoin/23.0/linuxarm32v7.Dockerfile
Normal file
45
Bitcoin/23.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 23.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 952c574366aff76f6d6ad1c9ee45a361d64fa04155e973e926dfe7e26f9703a3
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
Bitcoin/23.0/linuxarm64v8.Dockerfile
Normal file
45
Bitcoin/23.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 23.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 06f4c78271a77752ba5990d60d81b1751507f77efda1e5981b4e92fd4d9969fb
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
80
Bitcoin/24.0.1/docker-entrypoint.sh
Executable file
80
Bitcoin/24.0.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
43
Bitcoin/24.0.1/linuxamd64.Dockerfile
Normal file
43
Bitcoin/24.0.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,43 @@
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 24.0.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 49df6e444515d457ea0b885d66f521f2a26ca92ccf73d5296082e633544253bf
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
48
Bitcoin/24.0.1/linuxarm32v7.Dockerfile
Normal file
48
Bitcoin/24.0.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,48 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.0.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 37d7660f0277301744e96426bbb001d2206b8d4505385dfdeedf50c09aaaef60
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
48
Bitcoin/24.0.1/linuxarm64v8.Dockerfile
Normal file
48
Bitcoin/24.0.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,48 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.0.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 0b48b9e69b30037b41a1e6b78fb7cbcc48c7ad627908c99686e81f3802454609
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
66
Bitcoin/24.0/docker-entrypoint.sh
Executable file
66
Bitcoin/24.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
40
Bitcoin/24.0/linuxamd64.Dockerfile
Normal file
40
Bitcoin/24.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 24.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 fb86cf6af7a10bc5f3ae6cd6a5b0348854e1462102fe71e755d30b51b6e317d1
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
Bitcoin/24.0/linuxarm32v7.Dockerfile
Normal file
45
Bitcoin/24.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 806f822a0498bb4f93ba13d6370e544c2344a768cd45c5a24cab1e7e87930204
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
Bitcoin/24.0/linuxarm64v8.Dockerfile
Normal file
45
Bitcoin/24.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 904e103f08f776d03935118568411724f9e070e0e888e52c9e5692308fa47d49
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/24.1/docker-entrypoint.sh
Executable file
81
Bitcoin/24.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/24.1/linuxamd64.Dockerfile
Normal file
46
Bitcoin/24.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 24.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 c112af3d19cca7f5b5f942708ca4d522110d8e1dc1c0f8d3077f531c94e5f00f
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/24.1/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/24.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 96d8c7369972848833bddbeaa07351c2843429788151d86bde2ff6f7a756ea52
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/24.1/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/24.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 24.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 69ef67b290ce05120d8a5a5a5c0aa3e7d4878838286e6dc96935d15fc0d44b56
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/25.0/docker-entrypoint.sh
Executable file
81
Bitcoin/25.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/25.0/linuxamd64.Dockerfile
Normal file
46
Bitcoin/25.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 25.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 33930d432593e49d58a9bff4c30078823e9af5d98594d2935862788ce8a20aec
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bullseye-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/25.0/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/25.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 25.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 e537c8630b05e63242d979c3004f851fd73c2a10b5b4fdbb161788427c7b3c0f
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/25.0/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/25.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bullseye-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 25.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 3a7bdd959a0b426624f63f394f25e5b7769a5a2f96f8126dcc2ea53f3fa5212b
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bullseye-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/25.1/docker-entrypoint.sh
Executable file
81
Bitcoin/25.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/25.1/linuxamd64.Dockerfile
Normal file
46
Bitcoin/25.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 25.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 a978c407b497a727f0444156e397b50491ce862d1f906fef9b521415b3611c8b
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/25.1/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/25.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 25.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 28b8811984e215d9dc42536394629029edc1d15ab896f007d54d1d42a343f9db
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/25.1/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/25.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 25.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 69b49bd4eda484a8b8e0e806649e5b7ae9b93b3dbb9889af23696437359bc52c
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/26.0/docker-entrypoint.sh
Executable file
81
Bitcoin/26.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/26.0/linuxamd64.Dockerfile
Normal file
46
Bitcoin/26.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 26.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 23e5ab226d9e01ffaadef5ffabe8868d0db23db952b90b0593652993680bb8ab
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/26.0/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/26.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 26.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 e02b8b02fffc74f603bd7030809fefd3d95808e059f1da5e3269d5d98f18809b
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/26.0/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/26.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 26.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 9cf64f42c72d8a96892aa1e2ec9cbca6f3b7094148a8261127390bc6fb4d20c4
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/27.1/docker-entrypoint.sh
Executable file
81
Bitcoin/27.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/27.1/linuxamd64.Dockerfile
Normal file
46
Bitcoin/27.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 27.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/27.1/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/27.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 27.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 83bf6da65ebac189c7e14f1e68a758b32b8f83558b36b53a8cc8037c674ab045
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/27.1/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/27.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 27.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 bb878df4f8ff8fb8acfb94207c50f959c462c39e652f507c2a2db20acc6a1eee
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/28.1/docker-entrypoint.sh
Executable file
81
Bitcoin/28.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/28.1/linuxamd64.Dockerfile
Normal file
46
Bitcoin/28.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 28.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 07f77afd326639145b9ba9562912b2ad2ccec47b8a305bd075b4f4cb127b7ed7
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/28.1/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/28.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 28.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 6448274420ac632c528bbd4da7198692232cef7bd16d101febc5d05f7d4af1d2
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/28.1/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/28.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 28.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 6ddb6990690bd4c9a9f4319ed6f6e9c995c85ce5530ee9f120e80ce09e090c44
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/29.0/docker-entrypoint.sh
Executable file
81
Bitcoin/29.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/29.0/linuxamd64.Dockerfile
Normal file
46
Bitcoin/29.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 a681e4f6ce524c338a105f214613605bac6c33d58c31dc5135bbc02bc458bb6c
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.0/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/29.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 ea8ca24ab56d486a55289c43cb4256f9f0e66224899cc43482c9498a3f2614d1
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.0/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/29.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 7922ac99363dd28f79e57ef7098581fd48ebd1119b412b07e73b1fd19fd0443f
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/29.1/docker-entrypoint.sh
Executable file
81
Bitcoin/29.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/29.1/linuxamd64.Dockerfile
Normal file
46
Bitcoin/29.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 2dddeaa8c0626ec446b6f21b64c0f3565a1e7e67ff0b586d25043cbd686c9455
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.1/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/29.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 aec1838105c44a97e10bd7a47af52d83728c98272f9e32650b3fe83ed78f9dec
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.1/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/29.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.1
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 d6be913e1abc5effe57f50630b4bff2f89b38c092182c47f1fcde0ae12afc71c
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
Bitcoin/29.2/docker-entrypoint.sh
Executable file
81
Bitcoin/29.2/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/29.2/linuxamd64.Dockerfile
Normal file
46
Bitcoin/29.2/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 1fd58d0ae94b8a9e21bbaeab7d53395a44976e82bd5492b0a894826c135f9009
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.2/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/29.2/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 3a19e89082db0f891751c1484adf41bcd8fd12ed57e40ed177765436bed72aa1
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/29.2/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/29.2/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 f88f72a3c5bf526581aae573be8c1f62133eaecfe3d34646c9ffca7b79dfdc7a
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
90
Bitcoin/30.2/docker-entrypoint.sh
Executable file
90
Bitcoin/30.2/docker-entrypoint.sh
Executable file
@ -0,0 +1,90 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
is_sqlite()
|
||||
{
|
||||
local f=$1
|
||||
# read first 16 bytes and compare to the SQLite header
|
||||
printf 'SQLite format 3\0' | cmp -n 16 -s - "$f"
|
||||
}
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'[main]'
|
||||
fi
|
||||
|
||||
need_migrate=false
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-${BITCOIN_NETWORK}" "-datadir=${WALLETDIR}" "-wallet=" create
|
||||
elif ! is_sqlite "${WALLETFILE}"; then
|
||||
need_migrate=true
|
||||
echo "Legacy wallet migration needed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
if [[ "${need_migrate}" == "true" ]]; then
|
||||
echo "Migrating legacy bitcoin wallet..."
|
||||
gosu bitcoin "$@" &
|
||||
BITCOIN_PID=$!
|
||||
gosu bitcoin bitcoin-cli -datadir="${BITCOIN_DATA}" -rpcwait migratewallet ""
|
||||
gosu bitcoin bitcoin-cli -datadir="${BITCOIN_DATA}" -rpcwait stop
|
||||
wait "${BITCOIN_PID}"
|
||||
echo "Bitcoin legacy wallet migrated."
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/30.2/linuxamd64.Dockerfile
Normal file
46
Bitcoin/30.2/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 30.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 6aa7bb4feb699c4c6262dd23e4004191f6df7f373b5d5978b5bcdd4bb72f75d8
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/30.2/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/30.2/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 30.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 d510542842318ea34d87cb2c93d6a7fe091dcac2e8684460be2b3c44843fb502
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/30.2/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/30.2/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 30.2
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 73e76c14edc79808a0511c744d102ffbb494807ee90cbcba176568243254b532
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
145
Bitcoin/31.0/docker-entrypoint.sh
Executable file
145
Bitcoin/31.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,145 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
is_sqlite()
|
||||
{
|
||||
local f=$1
|
||||
# read first 16 bytes and compare to the SQLite header
|
||||
printf 'SQLite format 3\0' | cmp -n 16 -s - "$f"
|
||||
}
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'[main]'
|
||||
fi
|
||||
|
||||
need_migrate=false
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLET_NAME="default"
|
||||
NETWORK_WALLETDIR="${BITCOIN_WALLETDIR}/${BITCOIN_NETWORK}"
|
||||
WALLETDIR="${NETWORK_WALLETDIR}/${WALLET_NAME}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
LEGACY_WALLETDIR="${NETWORK_WALLETDIR}"
|
||||
LEGACY_WALLETFILE="${LEGACY_WALLETDIR}/wallet.dat"
|
||||
mkdir -p "${NETWORK_WALLETDIR}"
|
||||
chown -R bitcoin:bitcoin "${NETWORK_WALLETDIR}"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${NETWORK_WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
|
||||
if [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}wallet=${WALLET_NAME}${NL}"
|
||||
if [[ -f "${LEGACY_WALLETFILE}" ]] && ! [[ -f "${WALLETFILE}" ]]; then
|
||||
mkdir -p "${WALLETDIR}"
|
||||
chown -R bitcoin:bitcoin "${WALLETDIR}"
|
||||
mv "${LEGACY_WALLETFILE}" "${WALLETFILE}"
|
||||
[[ -f "${LEGACY_WALLETDIR}/db.log" ]] && mv "${LEGACY_WALLETDIR}/db.log" "${WALLETDIR}/db.log"
|
||||
[[ -f "${LEGACY_WALLETDIR}/database" ]] && mv "${LEGACY_WALLETDIR}/database" "${WALLETDIR}/database"
|
||||
echo "Moved ${LEGACY_WALLETFILE} -> ${WALLETFILE}"
|
||||
fi
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${NETWORK_WALLETDIR}..."
|
||||
case "${BITCOIN_NETWORK}" in
|
||||
mainnet)
|
||||
NETWORK_FLAG=""
|
||||
;;
|
||||
testnet)
|
||||
NETWORK_FLAG="-testnet"
|
||||
;;
|
||||
signet)
|
||||
NETWORK_FLAG="-signet"
|
||||
;;
|
||||
regtest)
|
||||
NETWORK_FLAG="-regtest"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown BITCOIN_NETWORK: ${BITCOIN_NETWORK}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
gosu bitcoin bitcoin-wallet ${NETWORK_FLAG} "-datadir=${NETWORK_WALLETDIR}" "-wallet=${WALLET_NAME}" create
|
||||
|
||||
# This stupid utility is creating the file somewhere depending on the network flag...
|
||||
case "${BITCOIN_NETWORK}" in
|
||||
mainnet)
|
||||
;;
|
||||
testnet)
|
||||
mv "${NETWORK_WALLETDIR}/testnet3/default" "${NETWORK_WALLETDIR}/default"
|
||||
rm -rf "${NETWORK_WALLETDIR}/testnet3"
|
||||
;;
|
||||
signet)
|
||||
mv "${NETWORK_WALLETDIR}/signet/default" "${NETWORK_WALLETDIR}/default"
|
||||
rm -rf "${NETWORK_WALLETDIR}/signet"
|
||||
;;
|
||||
regtest)
|
||||
mv "${NETWORK_WALLETDIR}/regtest/default" "${NETWORK_WALLETDIR}/default"
|
||||
rm -rf "${NETWORK_WALLETDIR}/regtest"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown BITCOIN_NETWORK: ${BITCOIN_NETWORK}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
elif ! is_sqlite "${WALLETFILE}"; then
|
||||
need_migrate=true
|
||||
echo "Legacy wallet migration needed"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
if [[ "${need_migrate}" == "true" ]]; then
|
||||
echo "Migrating legacy bitcoin wallet..."
|
||||
gosu bitcoin "$@" &
|
||||
BITCOIN_PID=$!
|
||||
gosu bitcoin bitcoin-cli -datadir="${BITCOIN_DATA}" -rpcwait migratewallet "${WALLET_NAME}"
|
||||
gosu bitcoin bitcoin-cli -datadir="${BITCOIN_DATA}" -rpcwait stop
|
||||
wait "${BITCOIN_PID}"
|
||||
echo "Bitcoin legacy wallet migrated."
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
Bitcoin/31.0/linuxamd64.Dockerfile
Normal file
46
Bitcoin/31.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 31.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 d3e4c58a35b1d0a97a457462c94f55501ad167c660c245cb1ffa565641c65074
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/31.0/linuxarm32v7.Dockerfile
Normal file
51
Bitcoin/31.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 31.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 8c19d007bfc73502625095ea4073af3a98ceb722d500556ab173bac5bcadd0d6
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
Bitcoin/31.0/linuxarm64v8.Dockerfile
Normal file
51
Bitcoin/31.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 31.0
|
||||
ENV BITCOIN_URL https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 4de1d568dedd48604f75132421bc0abeca432639589b49a3909c81db3a813112
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
65
BitcoinKnots/0.21.1/docker-entrypoint.sh
Executable file
65
BitcoinKnots/0.21.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
40
BitcoinKnots/0.21.1/linuxamd64.Dockerfile
Normal file
40
BitcoinKnots/0.21.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 0.21.1.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/0.21.x/0.21.1.knots20210629/bitcoin-0.21.1.knots20210629-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 e47c6e3d5f24721575d8289e1293aaf872be0db1f2e4934aa59b50fd9ca176c4
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/0.21.1/linuxarm32v7.Dockerfile
Normal file
45
BitcoinKnots/0.21.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 0.21.1.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/0.21.x/0.21.1.knots20210629/bitcoin-0.21.1.knots20210629-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 159250d0da388501ecb0817524f36f03489e87df3dee71096a338d2afb593a6a
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/0.21.1/linuxarm64v8.Dockerfile
Normal file
45
BitcoinKnots/0.21.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 0.21.1.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/0.21.x/0.21.1.knots20210629/bitcoin-0.21.1.knots20210629-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 c72d4a726ecda2993ce728e0a829e1432cbf53b9d4853a253813c1894178f019
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
65
BitcoinKnots/21.2/docker-entrypoint.sh
Executable file
65
BitcoinKnots/21.2/docker-entrypoint.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
40
BitcoinKnots/21.2/linuxamd64.Dockerfile
Normal file
40
BitcoinKnots/21.2/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 21.2.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/21.x/21.2.knots20210629/bitcoin-21.2.knots20210629-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 14aaefd38fd863be8f23435cdd4f0c20f42516c94a6d51a9ddf805121daff3ab
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/21.2/linuxarm32v7.Dockerfile
Normal file
45
BitcoinKnots/21.2/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 21.2.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/21.x/21.2.knots20210629/bitcoin-21.2.knots20210629-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 0a1ff89f825d2822b8c69cb308633dc822fc373635a87cd8cceb29a68c40dac8
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/21.2/linuxarm64v8.Dockerfile
Normal file
45
BitcoinKnots/21.2/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 21.2.knots20210629
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/21.x/21.2.knots20210629/bitcoin-21.2.knots20210629-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 f33fdd9c67741be257d22c889e5ba05b093db9ad8a7e5c1c10c5c769599979d4
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
65
BitcoinKnots/23.0/docker-entrypoint.sh
Executable file
65
BitcoinKnots/23.0/docker-entrypoint.sh
Executable file
@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
if ! [[ -f "${WALLETFILE}" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
40
BitcoinKnots/23.0/linuxamd64.Dockerfile
Normal file
40
BitcoinKnots/23.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,40 @@
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 23.0.knots20220529
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/23.x/23.0.knots20220529/bitcoin-23.0.knots20220529-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 d3350529a741d66312fc0f1b509bb91e3845e29830572aca23c865c96d5bdec9
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/23.0/linuxarm32v7.Dockerfile
Normal file
45
BitcoinKnots/23.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 23.0.knots20220529
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/23.x/23.0.knots20220529/bitcoin-23.0.knots20220529-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 9089b525aa0edfffde7aeb0c14b8a76e681bbe9cd840a4e70bfeec5c06589cca
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-armhf" \
|
||||
&& echo "171b4a2decc920de0dd4f49278d3e14712da5fa48de57c556f99bcdabe03552e gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm32v7/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
45
BitcoinKnots/23.0/linuxarm64v8.Dockerfile
Normal file
45
BitcoinKnots/23.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:buster-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 23.0.knots20220529
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/23.x/23.0.knots20220529/bitcoin-23.0.knots20220529-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 83d3c195a1b93b94830c2b33b6f7ec81b5f947b98cc5097eeee76a6a7e3e3652
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64" \
|
||||
&& echo "5e279972a1c7adee65e3b5661788e8706594b458b7ce318fecbd392492cc4dbd gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM arm64v8/debian:buster-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
BitcoinKnots/28.1/docker-entrypoint.sh
Executable file
81
BitcoinKnots/28.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
BitcoinKnots/28.1/linuxamd64.Dockerfile
Normal file
46
BitcoinKnots/28.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 28.1.knots20250305
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/28.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 dd80fa2c5076299e79cb1df03f1813ef0364e9b8b8288d0746f1d21983ceac72
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/28.1/linuxarm32v7.Dockerfile
Normal file
51
BitcoinKnots/28.1/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 28.1.knots20250305
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/28.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 22b2aaf02e374779a47e8c7fcff5b811a898878093e5707580b23ec668042638
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/28.1/linuxarm64v8.Dockerfile
Normal file
51
BitcoinKnots/28.1/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 28.1.knots20250305
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/28.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 87b5f3c96d23f043eb6f8faac63dc37eee5ecc1573b3edea9a4aa70756e42761
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
BitcoinKnots/29.2.knots20251110/docker-entrypoint.sh
Executable file
81
BitcoinKnots/29.2.knots20251110/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
BitcoinKnots/29.2.knots20251110/linuxamd64.Dockerfile
Normal file
46
BitcoinKnots/29.2.knots20251110/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.2.knots20251110
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 eb018a2274ab6cdcba3647c20a59731760545a2e85f0f863d45435dbcf4e7348
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.2.knots20251110/linuxarm32v7.Dockerfile
Normal file
51
BitcoinKnots/29.2.knots20251110/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.2.knots20251110
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 4bcd6ecc6091e6845e7e44350da0f8f6484eb2a878a8c1083550871b3a18f84b
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.2.knots20251110/linuxarm64v8.Dockerfile
Normal file
51
BitcoinKnots/29.2.knots20251110/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.2.knots20251110
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 6a8dad8b9f6d3d967f39c926808e027ebd0350342d3bdf7848edfb86b8f65a66
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
BitcoinKnots/29.3.knots20260210/docker-entrypoint.sh
Executable file
81
BitcoinKnots/29.3.knots20260210/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
BitcoinKnots/29.3.knots20260210/linuxamd64.Dockerfile
Normal file
46
BitcoinKnots/29.3.knots20260210/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260210
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 7611d9edbb21c4014999f4b2c3111e9634c86036424244a01e66edf919da3ef7
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.3.knots20260210/linuxarm32v7.Dockerfile
Normal file
51
BitcoinKnots/29.3.knots20260210/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260210
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 5cf9a3cf45042ad1718b86722c9165da278e0db1a515213c2f98cf955ab71837
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.3.knots20260210/linuxarm64v8.Dockerfile
Normal file
51
BitcoinKnots/29.3.knots20260210/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260210
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 cc495cd3c0b52769d70d9aad1116e2733ece4d100542060d3b9835112773e552
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
81
BitcoinKnots/29.3.knots20260508/docker-entrypoint.sh
Executable file
81
BitcoinKnots/29.3.knots20260508/docker-entrypoint.sh
Executable file
@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
elif [[ "${BITCOIN_NETWORK}" == "signet" ]]; then
|
||||
CONFIG_PREFIX=$'signet=1\n[signet]'
|
||||
else
|
||||
BITCOIN_NETWORK="mainnet"
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
if [[ "$BITCOIN_WALLETDIR" ]] && [[ "$BITCOIN_NETWORK" ]]; then
|
||||
NL=$'\n'
|
||||
WALLETDIR="$BITCOIN_WALLETDIR/${BITCOIN_NETWORK}"
|
||||
WALLETFILE="${WALLETDIR}/wallet.dat"
|
||||
mkdir -p "$WALLETDIR"
|
||||
chown -R bitcoin:bitcoin "$WALLETDIR"
|
||||
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
|
||||
: "${CREATE_WALLET:=true}"
|
||||
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
|
||||
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
|
||||
gosu bitcoin bitcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
|
||||
fi
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
|
||||
|
||||
if [[ "${BITCOIN_TORCONTROL}" ]]; then
|
||||
# Because bitcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
|
||||
TOR_CONTROL_HOST=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 1)
|
||||
TOR_CONTROL_PORT=$(echo ${BITCOIN_TORCONTROL} | cut -d ':' -f 2)
|
||||
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
|
||||
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
|
||||
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$BITCOIN_DATA/bitcoin.conf"
|
||||
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $BITCOIN_DATA/bitcoin.conf"
|
||||
else
|
||||
echo "Invalid BITCOIN_TORCONTROL"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
rm -f /home/bitcoin/.bitcoin/settings.json
|
||||
|
||||
# peers_dat is routinely corrupted, preventing bitcoind to start, see https://github.com/bitcoin/bitcoin/issues/26599
|
||||
# This should be fixed in 24.1, but doesn't hurt to keep it
|
||||
peers_dat="/home/bitcoin/.bitcoin/peers.dat"
|
||||
peers_dat_corrupted="/home/bitcoin/.bitcoin/peers_corrupted.dat"
|
||||
if [[ -f "${peers_dat}" ]]; then
|
||||
actual_hash=$(head -c -32 "${peers_dat}" | sha256sum | cut -c1-64 | xxd -r -p | sha256sum | cut -c1-64)
|
||||
expected_hash=$(tail -c 32 "${peers_dat}" | xxd -ps -c 32)
|
||||
if [[ "${actual_hash}" != "${expected_hash}" ]]; then
|
||||
echo "${peers_dat} is corrupted, moving it to ${peers_dat_corrupted}"
|
||||
rm -f "${peers_dat_corrupted}"
|
||||
mv "${peers_dat}" "${peers_dat_corrupted}"
|
||||
fi
|
||||
fi
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
46
BitcoinKnots/29.3.knots20260508/linuxamd64.Dockerfile
Normal file
46
BitcoinKnots/29.3.knots20260508/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,46 @@
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260508
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 70bd12fb56a2fe3908e0f44f7f142f77a55aabc8427bf00b61cfa4deedcf0899
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
|
||||
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.3.knots20260508/linuxarm32v7.Dockerfile
Normal file
51
BitcoinKnots/29.3.knots20260508/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260508
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
|
||||
ENV BITCOIN_SHA256 158c93aaef9d0ab990c2c500d59f1ab47f74c691e211cdf7a4b96eb84e70fdfc
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
|
||||
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
51
BitcoinKnots/29.3.knots20260508/linuxarm64v8.Dockerfile
Normal file
51
BitcoinKnots/29.3.knots20260508/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,51 @@
|
||||
# Use manifest image which support all architecture
|
||||
FROM debian:bookworm-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
|
||||
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support
|
||||
|
||||
ENV BITCOIN_VERSION 29.3.knots20260508
|
||||
ENV BITCOIN_URL https://bitcoinknots.org/files/29.x/${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-aarch64-linux-gnu.tar.gz
|
||||
ENV BITCOIN_SHA256 c80ed10834ed96f532bd673d6f691b960ddb00f6889d1fed9a3dcbf14284e01c
|
||||
|
||||
# install bitcoin binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
|
||||
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf bitcoin.tar.gz -C /tmp/bin --strip-components=2 "bitcoin-$BITCOIN_VERSION/bin/bitcoin-cli" "bitcoin-$BITCOIN_VERSION/bin/bitcoind" "bitcoin-$BITCOIN_VERSION/bin/bitcoin-wallet" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
|
||||
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -
|
||||
|
||||
# Making sure the builder build an arm image despite being x64
|
||||
FROM --platform=arm64 debian:bookworm-slim
|
||||
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
|
||||
|
||||
ARG BITCOIN_USER_ID=999
|
||||
ARG BITCOIN_GROUP_ID=999
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -qq --no-install-recommends xxd && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $BITCOIN_GROUP_ID bitcoin && useradd -r -m -u $BITCOIN_USER_ID -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
34
Cloudflared/2022.6.3/linuxamd64.Dockerfile
Normal file
34
Cloudflared/2022.6.3/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=amd64
|
||||
ARG TARGET_PLATFORM=amd64
|
||||
ARG CLOUDFLARED_VERSION=2022.6.3
|
||||
FROM golang:1.17.1 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian10:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
34
Cloudflared/2022.6.3/linuxarm32v7.Dockerfile
Normal file
34
Cloudflared/2022.6.3/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=arm
|
||||
ARG TARGET_PLATFORM=arm
|
||||
ARG CLOUDFLARED_VERSION=2022.6.3
|
||||
FROM golang:1.17.1 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian10:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
34
Cloudflared/2022.6.3/linuxarm64v8.Dockerfile
Normal file
34
Cloudflared/2022.6.3/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=arm64
|
||||
ARG TARGET_PLATFORM=arm64
|
||||
ARG CLOUDFLARED_VERSION=2022.6.3
|
||||
FROM golang:1.17.1 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian10:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
26
Cloudflared/2023.10.0/linuxamd64.Dockerfile
Normal file
26
Cloudflared/2023.10.0/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM golang:1.20.6 as builder
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
CLOUDFLARED_VERSION=2023.10.0
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
# copy our sources into the builder image
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN GOOS=linux GOARCH=amd64 make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=amd64 gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
26
Cloudflared/2023.10.0/linuxarm32v7.Dockerfile
Normal file
26
Cloudflared/2023.10.0/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM golang:1.20.6 as builder
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
CLOUDFLARED_VERSION=2023.10.0
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
# copy our sources into the builder image
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN GOOS=linux GOARCH=arm make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=arm gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
26
Cloudflared/2023.10.0/linuxarm64v8.Dockerfile
Normal file
26
Cloudflared/2023.10.0/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM golang:1.20.6 as builder
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
CLOUDFLARED_VERSION=2023.10.0
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
# copy our sources into the builder image
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN GOOS=linux GOARCH=arm64 make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=arm64 gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
34
Cloudflared/2023.7.3/linuxamd64.Dockerfile
Normal file
34
Cloudflared/2023.7.3/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=amd64
|
||||
ARG TARGET_PLATFORM=amd64
|
||||
ARG CLOUDFLARED_VERSION=2023.7.3
|
||||
FROM golang:1.19 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
34
Cloudflared/2023.7.3/linuxarm32v7.Dockerfile
Normal file
34
Cloudflared/2023.7.3/linuxarm32v7.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=arm
|
||||
ARG TARGET_PLATFORM=arm
|
||||
ARG CLOUDFLARED_VERSION=2023.7.3
|
||||
FROM golang:1.19 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
34
Cloudflared/2023.7.3/linuxarm64v8.Dockerfile
Normal file
34
Cloudflared/2023.7.3/linuxarm64v8.Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
# use a builder image for building cloudflare
|
||||
ARG TARGET_GOOS=linux
|
||||
ARG TARGET_GOARCH=arm64
|
||||
ARG TARGET_PLATFORM=arm64
|
||||
ARG CLOUDFLARED_VERSION=2023.7.3
|
||||
FROM golang:1.19 as builder
|
||||
ARG CLOUDFLARED_VERSION
|
||||
ARG TARGET_GOARCH
|
||||
ARG TARGET_GOOS
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
TARGET_OS=${TARGET_GOOS} \
|
||||
TARGET_ARCH=${TARGET_GOARCH}
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM --platform=${TARGET_PLATFORM} gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
28
Cloudflared/2024.8.2/Dockerfile
Normal file
28
Cloudflared/2024.8.2/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM --platform=$BUILDPLATFORM golang:1.23.0 AS builder
|
||||
|
||||
ARG TARGETARCH
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLED=0 \
|
||||
CLOUDFLARED_VERSION=2024.8.2
|
||||
WORKDIR /go/src/github.com/cloudflare/cloudflared/
|
||||
|
||||
# copy our sources into the builder image
|
||||
RUN git clone --branch ${CLOUDFLARED_VERSION} --single-branch --depth 1 https://github.com/cloudflare/cloudflared.git .
|
||||
|
||||
# compile cloudflared
|
||||
RUN GOOS=linux GOARCH=${TARGETARCH} make cloudflared
|
||||
|
||||
# use a distroless base image with glibc
|
||||
FROM gcr.io/distroless/base-debian11:nonroot
|
||||
|
||||
LABEL org.opencontainers.image.source="https://github.com/cloudflare/cloudflared"
|
||||
|
||||
# copy our compiled binary
|
||||
COPY --from=builder --chown=nonroot /go/src/github.com/cloudflare/cloudflared/cloudflared /usr/local/bin/
|
||||
|
||||
# run as non-privileged user
|
||||
USER nonroot
|
||||
|
||||
# command / entrypoint of container
|
||||
ENTRYPOINT ["cloudflared", "--no-autoupdate"]
|
||||
CMD ["version"]
|
||||
36
Dash/18.0.1/docker-entrypoint.sh
Executable file
36
Dash/18.0.1/docker-entrypoint.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "dash-cli" || "$1" == "dash-tx" || "$1" == "dashd" || "$1" == "test_dash" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
CONFIG_PREFIX=""
|
||||
if [[ "${BITCOIN_NETWORK}" == "regtest" ]]; then
|
||||
CONFIG_PREFIX=$'regtest=1\n[regtest]'
|
||||
fi
|
||||
if [[ "${BITCOIN_NETWORK}" == "testnet" ]]; then
|
||||
CONFIG_PREFIX=$'testnet=1\n[test]'
|
||||
fi
|
||||
if [[ "${BITCOIN_NETWORK}" == "mainnet" ]]; then
|
||||
CONFIG_PREFIX=$'mainnet=1\n[main]'
|
||||
fi
|
||||
|
||||
cat <<-EOF > "$BITCOIN_DATA/dash.conf"
|
||||
${CONFIG_PREFIX}
|
||||
printtoconsole=1
|
||||
rpcallowip=::/0
|
||||
${BITCOIN_EXTRA_ARGS}
|
||||
EOF
|
||||
chown bitcoin:bitcoin "$BITCOIN_DATA/dash.conf"
|
||||
|
||||
# ensure correct ownership and linking of data directory
|
||||
# we do not update group ownership here, in case users want to mount
|
||||
# a host directory and still retain access to it
|
||||
chown -R bitcoin "$BITCOIN_DATA"
|
||||
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.dashcore
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.dashcore
|
||||
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
45
Dash/18.0.1/linuxamd64.Dockerfile
Normal file
45
Dash/18.0.1/linuxamd64.Dockerfile
Normal file
@ -0,0 +1,45 @@
|
||||
FROM debian:stretch-slim as builder
|
||||
|
||||
RUN set -ex \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget
|
||||
|
||||
ENV DASH_VERSION 18.0.1
|
||||
ENV DASH_URL https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/dashcore-${DASH_VERSION}-x86_64-linux-gnu.tar.gz
|
||||
ENV DASH_SHA256 c1fea7a83bbef34a358112f2a980ca4eb213aaea2f82486c6460100b2f22e317
|
||||
ENV DASH_ASC_URL https://github.com/dashpay/dash/releases/download/v${DASH_VERSION}/SHA256SUMS.asc
|
||||
ENV DASH_PGP_KEY 52527BEDABE87984
|
||||
|
||||
# install dash binaries
|
||||
RUN set -ex \
|
||||
&& cd /tmp \
|
||||
&& wget -qO dash.tar.gz "$DASH_URL" \
|
||||
&& echo "$DASH_SHA256 dash.tar.gz" | sha256sum -c - \
|
||||
&& gpg --keyserver keyserver.ubuntu.com --recv-keys "$DASH_PGP_KEY" \
|
||||
&& wget -qO dash.asc "$DASH_ASC_URL" \
|
||||
&& gpg --verify dash.asc \
|
||||
&& mkdir bin \
|
||||
&& tar -xzvf dash.tar.gz -C /tmp/bin --strip-components=2 "dashcore-$DASH_VERSION/bin/dash-cli" "dashcore-$DASH_VERSION/bin/dashd" \
|
||||
&& cd bin \
|
||||
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.11/gosu-amd64" \
|
||||
&& echo "0b843df6d86e270c5b0f5cbd3c326a04e18f4b7f9b8457fa497b0454c4b138d7 gosu" | sha256sum -c -
|
||||
|
||||
FROM debian:stretch-slim
|
||||
COPY --from=builder "/tmp/bin" /usr/local/bin
|
||||
|
||||
RUN chmod +x /usr/local/bin/gosu && groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin
|
||||
|
||||
# create data directory
|
||||
ENV BITCOIN_DATA /data
|
||||
RUN mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.dashcore \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.dashcore
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY docker-entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 9998 9999 19998 19999
|
||||
CMD ["dashd"]
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user