Blockstream / esplora

Explorer for Bitcoin and Liquid
MIT License
1.02k stars 400 forks source link

Docker build fails for Apple Silicon Macbook #486

Open Mister-EA opened 8 months ago

Mister-EA commented 8 months ago

This is the error I am getting when building the docker image on Macbook M1 CPU:

docker build -t esplora .              
[+] Building 1.4s (15/19)                                                          docker:desktop-linux
 => [internal] load build definition from Dockerfile                                               0.0s
 => => transferring dockerfile: 2.67kB                                                             0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye@sha256:4d6ab716de467aad58e91b1  1.9s
 => [internal] load metadata for docker.io/blockstream/esplora-base:latest                         1.9s
 => [internal] load .dockerignore                                                                  0.0s
 => => transferring context: 341B                                                                  0.0s
 => [stage-1  1/13] FROM docker.io/library/debian:bullseye@sha256:4d6ab716de467aad58e91b1b720f0ba  0.0s
 => [internal] load build context                                                                  0.0s
 => => transferring context: 16.48kB                                                               0.0s
 => [build 1/1] FROM docker.io/blockstream/esplora-base:latest@sha256:a6df919d40a209cabbd34b22a05  0.0s
 => CACHED [stage-1  2/13] COPY --from=build /srv/explorer /srv/explorer                           0.0s
 => CACHED [stage-1  3/13] COPY --from=build /srv/wally_wasm /srv/wally_wasm                       0.0s
 => CACHED [stage-1  4/13] COPY --from=build /root/.nvm /root/.nvm                                 0.0s
 => CACHED [stage-1  5/13] RUN apt-get -yqq update  && apt-get -yqq upgrade  && apt-get -yqq inst  0.0s
 => CACHED [stage-1  6/13] RUN mkdir -p /srv/explorer/static                                       0.0s
 => CACHED [stage-1  7/13] COPY ./ /srv/explorer/source                                            0.0s
 => CACHED [stage-1  8/13] WORKDIR /srv/explorer/source                                            0.0s
 => ERROR [stage-1  9/13] RUN source /root/.nvm/nvm.sh  && npm config set unsafe-perm true  && np  0.2s
------                                                                                                  
 > [stage-1  9/13] RUN source /root/.nvm/nvm.sh  && npm config set unsafe-perm true  && npm install && (cd prerender-server && npm run dist)  && DEST=/srv/explorer/static/bitcoin-mainnet     npm run dist -- bitcoin-mainnet  && DEST=/srv/explorer/static/bitcoin-testnet     npm run dist -- bitcoin-testnet  && DEST=/srv/explorer/static/bitcoin-signet     npm run dist -- bitcoin-signet  && DEST=/srv/explorer/static/bitcoin-regtest     npm run dist -- bitcoin-regtest  && DEST=/srv/explorer/static/liquid-mainnet     npm run dist -- liquid-mainnet  && DEST=/srv/explorer/static/liquid-testnet     npm run dist -- liquid-testnet  && DEST=/srv/explorer/static/liquid-regtest     npm run dist -- liquid-regtest  && DEST=/srv/explorer/static/bitcoin-mainnet-blockstream     npm run dist -- bitcoin-mainnet blockstream  && DEST=/srv/explorer/static/bitcoin-testnet-blockstream     npm run dist -- bitcoin-testnet blockstream  && DEST=/srv/explorer/static/bitcoin-signet-blockstream     npm run dist -- bitcoin-signet blockstream  && DEST=/srv/explorer/static/bitcoin-regtest-blockstream     npm run dist -- bitcoin-regtest blockstream  && DEST=/srv/explorer/static/liquid-mainnet-blockstream     npm run dist -- liquid-mainnet blockstream  && DEST=/srv/explorer/static/liquid-testnet-blockstream     npm run dist -- liquid-testnet blockstream  && DEST=/srv/explorer/static/liquid-regtest-blockstream     npm run dist -- liquid-regtest blockstream:
0.178 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
0.178  /bin/bash: line 1:   147 Trace/breakpoint trap   npm config set unsafe-perm true
------
Dockerfile:24
--------------------
  23 |     # required to run some scripts as root (needed for docker)
  24 | >>> RUN source /root/.nvm/nvm.sh \
  25 | >>>  && npm config set unsafe-perm true \
  26 | >>>  && npm install && (cd prerender-server && npm run dist) \
  27 | >>>  && DEST=/srv/explorer/static/bitcoin-mainnet \
  28 | >>>     npm run dist -- bitcoin-mainnet \
  29 | >>>  && DEST=/srv/explorer/static/bitcoin-testnet \
  30 | >>>     npm run dist -- bitcoin-testnet \
  31 | >>>  && DEST=/srv/explorer/static/bitcoin-signet \
  32 | >>>     npm run dist -- bitcoin-signet \
  33 | >>>  && DEST=/srv/explorer/static/bitcoin-regtest \
  34 | >>>     npm run dist -- bitcoin-regtest \
  35 | >>>  && DEST=/srv/explorer/static/liquid-mainnet \
  36 | >>>     npm run dist -- liquid-mainnet \
  37 | >>>  && DEST=/srv/explorer/static/liquid-testnet \
  38 | >>>     npm run dist -- liquid-testnet \
  39 | >>>  && DEST=/srv/explorer/static/liquid-regtest \
  40 | >>>     npm run dist -- liquid-regtest \
  41 | >>>  && DEST=/srv/explorer/static/bitcoin-mainnet-blockstream \
  42 | >>>     npm run dist -- bitcoin-mainnet blockstream \
  43 | >>>  && DEST=/srv/explorer/static/bitcoin-testnet-blockstream \
  44 | >>>     npm run dist -- bitcoin-testnet blockstream \
  45 | >>>  && DEST=/srv/explorer/static/bitcoin-signet-blockstream \
  46 | >>>     npm run dist -- bitcoin-signet blockstream \
  47 | >>>  && DEST=/srv/explorer/static/bitcoin-regtest-blockstream \
  48 | >>>     npm run dist -- bitcoin-regtest blockstream \
  49 | >>>  && DEST=/srv/explorer/static/liquid-mainnet-blockstream \
  50 | >>>     npm run dist -- liquid-mainnet blockstream \
  51 | >>>  && DEST=/srv/explorer/static/liquid-testnet-blockstream \
  52 | >>>     npm run dist -- liquid-testnet blockstream \
  53 | >>>  && DEST=/srv/explorer/static/liquid-regtest-blockstream \
  54 | >>>     npm run dist -- liquid-regtest blockstream
  55 |     
--------------------
ERROR: failed to solve: process "/bin/bash -c source /root/.nvm/nvm.sh  && npm config set unsafe-perm true  && npm install && (cd prerender-server && npm run dist)  && DEST=/srv/explorer/static/bitcoin-mainnet     npm run dist -- bitcoin-mainnet  && DEST=/srv/explorer/static/bitcoin-testnet     npm run dist -- bitcoin-testnet  && DEST=/srv/explorer/static/bitcoin-signet     npm run dist -- bitcoin-signet  && DEST=/srv/explorer/static/bitcoin-regtest     npm run dist -- bitcoin-regtest  && DEST=/srv/explorer/static/liquid-mainnet     npm run dist -- liquid-mainnet  && DEST=/srv/explorer/static/liquid-testnet     npm run dist -- liquid-testnet  && DEST=/srv/explorer/static/liquid-regtest     npm run dist -- liquid-regtest  && DEST=/srv/explorer/static/bitcoin-mainnet-blockstream     npm run dist -- bitcoin-mainnet blockstream  && DEST=/srv/explorer/static/bitcoin-testnet-blockstream     npm run dist -- bitcoin-testnet blockstream  && DEST=/srv/explorer/static/bitcoin-signet-blockstream     npm run dist -- bitcoin-signet blockstream  && DEST=/srv/explorer/static/bitcoin-regtest-blockstream     npm run dist -- bitcoin-regtest blockstream  && DEST=/srv/explorer/static/liquid-mainnet-blockstream     npm run dist -- liquid-mainnet blockstream  && DEST=/srv/explorer/static/liquid-testnet-blockstream     npm run dist -- liquid-testnet blockstream  && DEST=/srv/explorer/static/liquid-regtest-blockstream     npm run dist -- liquid-regtest blockstream" did not complete successfully: exit code: 133

Is there a way around this?