ruimarinho / docker-bitcoin-core

A bitcoin-core docker image
https://hub.docker.com/r/ruimarinho/bitcoin-core/
MIT License
369 stars 208 forks source link

error validating checksum in debian docker build for 0.20.0 #99

Closed j4ys0n closed 4 years ago

j4ys0n commented 4 years ago

docker build -t btc .

Step 8/14 : RUN set -ex && if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi && if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi && for key in   01EA5486DE18A882D4C2684590C8019E36C2E964 ; do     gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ||     gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" ||     gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" ||     gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ||     gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ;   done && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && gpg --verify SHA256SUMS.asc && grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz\$" SHA256SUMS.asc | sha256sum -c - && tar -xzf *.tar.gz -C /opt && rm *.tar.gz *.asc && rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt
 ---> Running in 1d96a387a388
+ [  = linux/amd64 ]
+ [  = linux/arm64 ]
+ [  = linux/arm/v7 ]
+ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 01EA5486DE18A882D4C2684590C8019E36C2E964
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 90C8019E36C2E964: public key "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <laanwj@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
+ curl -SLO https://bitcoin.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   162  100   162    0     0    658      0 --:--:-- --:--:-- --:--:--   658
+ curl -SLO https://bitcoin.org/bin/bitcoin-core-0.20.0/SHA256SUMS.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1769  100  1769    0     0   7932      0 --:--:-- --:--:-- --:--:--  7932
+ gpg --verify SHA256SUMS.asc
gpg: Signature made Wed Jun  3 09:59:52 2020 UTC
gpg:                using RSA key 90C8019E36C2E964
gpg: Good signature from "Wladimir J. van der Laan (Bitcoin Core binary release signing key) <laanwj@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964
+ grep  bitcoin-0.20.0-.tar.gz$ SHA256SUMS.asc
+ sha256sum -c -
sha256sum: 'standard input': no properly formatted SHA256 checksum lines found
The command '/bin/sh -c set -ex && if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then export TARGETPLATFORM=x86_64-linux-gnu; fi && if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then export TARGETPLATFORM=aarch64-linux-gnu; fi && if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then export TARGETPLATFORM=arm-linux-gnueabihf; fi && for key in   01EA5486DE18A882D4C2684590C8019E36C2E964 ; do     gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ||     gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" ||     gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" ||     gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ||     gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" ;   done && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz && curl -SLO https://bitcoin.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc && gpg --verify SHA256SUMS.asc && grep " bitcoin-${BITCOIN_VERSION}-${TARGETPLATFORM}.tar.gz\$" SHA256SUMS.asc | sha256sum -c - && tar -xzf *.tar.gz -C /opt && rm *.tar.gz *.asc && rm -rf /opt/bitcoin-${BITCOIN_VERSION}/bin/bitcoin-qt' returned a non-zero code: 1
ruimarinho commented 4 years ago

You need to pass TARGETPLATFORM as a build arg to docker, otherwise it doesn't know what platform is it compiling for. I suggest taking a look at https://github.com/ruimarinho/docker-bitcoin-core/blob/master/.github/workflows/build.yaml to understand how to build it locally.

schildbach commented 4 years ago

I've been running into the same problem. Why isn't there a default?

ruimarinho commented 4 years ago

@schildbach this image uses the newer and more advanced BuildKit framework from docker, so technically those environment variables are being set by docker buildx and not myself. I don't mind defaulting the internal ARG TARGETPLATFORM to linux/amd64 to make docker build easier to run.