11ARG BITCOIND_VERSION=0.19.0.1
22
3- FROM alpine:3.11 AS builder
3+ FROM debian:buster-slim AS builder
44
55ARG BITCOIND_VERSION
66
7+ # Install dependencies and build the binaries.
8+ RUN apt-get update --yes \
9+ && apt-get install --no-install-recommends --yes \
10+ ca-certificates=20190110 \
11+ dirmngr=2.2.12-1+deb10u1 \
12+ gpg=2.2.12-1+deb10u1 \
13+ gpg-agent=2.2.12-1+deb10u1 \
14+ wget=1.20.1-1.1 \
15+ && apt-get clean \
16+ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
17+
718WORKDIR /bitcoin
819
920RUN set -eux; \
10- apkArch="$(apk --print-arch)" ; \
11- \
12- case "$apkArch" in \
13- x86) \
21+ arch="$(dpkg --print-architecture)" ; \
22+ case "$arch" in \
23+ i386) \
1424 url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-i686-pc-linux-gnu.tar.gz ;; \
15- x86_64 ) \
25+ amd64 ) \
1626 url=https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz ;; \
17- armv7 ) \
27+ armhf ) \
1828 url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-arm-linux-gnueabihf.tar.gz ;; \
19- aarch64 ) \
29+ arm64 ) \
2030 url=https://bitcoincore.org/bin/bitcoin-core-$BITCOIND_VERSION/bitcoin-$BITCOIND_VERSION-aarch64-linux-gnu.tar.gz ;; \
2131 *) \
22- echo >&2 "error: unsupported architecture ($apkArch )" ; exit 1 ;;\
32+ echo >&2 "error: unsupported architecture ($arch )" ; exit 1 ;;\
2333 esac; \
2434 \
25- wget -q -O- $url |tar xz -C /bitcoin --strip-components=1
35+ wget --quiet $url \
36+ && wget --quiet https://bitcoin.org/bin/bitcoin-core-$BITCOIND_VERSION/SHA256SUMS.asc \
37+ && gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964 \
38+ && gpg --verify SHA256SUMS.asc \
39+ && grep "${url##*/}" SHA256SUMS.asc | sha256sum -c - \
40+ && mkdir /bitcoind \
41+ && tar -xzf ./*.tar.gz -C /bitcoin --strip-components=1
2642
2743
2844# Start a new, final image.
29- FROM alpine:3.11 AS final
45+ FROM debian:buster-slim AS final
3046
3147ARG BUILD_DATE
3248ARG VCS_REF
@@ -35,26 +51,19 @@ ARG BITCOIND_VERSION
3551LABEL org.label-schema.schema-version="1.0" \
3652 org.label-schema.build-date=$BUILD_DATE \
3753 org.label-schema.name="legacycode/bitcoind" \
38- org.label-schema.description="A Docker image based on Alpine Linux ready to run a bitcoin full node!" \
54+ org.label-schema.description="A Docker image based on Debian Linux ready to run a bitcoin full node!" \
3955 org.label-schema.usage="https://hub.docker.com/r/legacycode/bitcoind" \
4056 org.label-schema.url="https://hub.docker.com/r/legacycode/bitcoind" \
4157 org.label-schema.vcs-url="https://github.com/legacycode/bitcoind-docker" \
4258 org.label-schema.vcs-ref=$VCS_REF \
4359 org.label-schema.version=$BITCOIND_VERSION \
4460 maintainer="info@legacycode.org"
4561
46- # Install dependencies and build the binaries.
47- RUN apk add --no-cache --update \
48- boost \
49- libevent \
50- openssl \
51- libzmq
52-
5362# Add user and group for bitcoin process.
54- RUN addgroup -S bitcoin \
55- && adduser -S bitcoin -G bitcoin \
56- && mkdir /home/bitcoin/.bitcoin \
57- && chown bitcoin: bitcoin /home/bitcoin/.bitcoin
63+ RUN useradd -r bitcoin \
64+ && mkdir -p /home/ bitcoin/. bitcoin \
65+ && chmod 700 /home/bitcoin/.bitcoin \
66+ && chown -R bitcoin /home/bitcoin/.bitcoin
5867
5968# Change user.
6069USER bitcoin
0 commit comments