moneroexamples / onion-monero-blockchain-explorer

Onion Monero Blockchain Explorer
https://xmrchain.net
BSD 3-Clause "New" or "Revised" License
361 stars 269 forks source link

Failing building docker container on Apple M1 Max #298

Closed meglio closed 6 months ago

meglio commented 7 months ago

Tried to run the following command:

docker build --no-cache -t xmrblocks .

Output tail:

127.1 [ 57%] Building CXX object src/rpc/CMakeFiles/obj_rpc.dir/rpc_payment.cpp.o
127.2 [ 57%] Linking CXX executable utf8_fuzz_tests
127.3 make[3]: Leaving directory '/root/monero/build/release'
127.3 [ 57%] Built target utf8_fuzz_tests
127.4 [ 57%] Building CXX object src/rpc/CMakeFiles/obj_rpc.dir/rpc_version_str.cpp.o
127.5 [ 58%] Building CXX object src/rpc/CMakeFiles/obj_rpc.dir/instanciations.cpp.o
128.7 [ 58%] Linking CXX executable load-from-json_fuzz_tests
128.8 make[3]: Leaving directory '/root/monero/build/release'
128.8 [ 58%] Built target load-from-json_fuzz_tests
128.8 [ 58%] Building CXX object tests/fuzz/CMakeFiles/load-from-binary_fuzz_tests.dir/fuzzer.cpp.o
128.8 [ 58%] Linking CXX executable ../../bin/monero-gen-ssl-cert
128.8 [ 58%] Building CXX object src/rpc/CMakeFiles/obj_daemon_rpc_server.dir/zmq_pub.cpp.o
129.0 make[3]: Leaving directory '/root/monero/build/release'
129.0 [ 58%] Built target gen_ssl_cert
129.0 [ 58%] Building CXX object src/rpc/CMakeFiles/obj_daemon_rpc_server.dir/zmq_server.cpp.o
130.3 [ 58%] Linking CXX executable load-from-binary_fuzz_tests
130.4 make[3]: Leaving directory '/root/monero/build/release'
130.4 [ 58%] Built target load-from-binary_fuzz_tests
130.8 make[3]: Leaving directory '/root/monero/build/release'
130.8 [ 58%] Built target obj_cryptonote_protocol
132.6 make[3]: Leaving directory '/root/monero/build/release'
132.7 [ 58%] Built target obj_daemon_rpc_server
171.9 make[3]: Leaving directory '/root/monero/build/release'
171.9 [ 58%] Built target obj_rpc
171.9 make[2]: Leaving directory '/root/monero/build/release'
171.9 make[1]: *** [Makefile:141: all] Error 2
171.9 make[1]: Leaving directory '/root/monero/build/release'
171.9 make: *** [Makefile:103: release-all] Error 2
------
Dockerfile:48
--------------------
  47 |     ARG NPROC
  48 | >>> RUN git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-project/monero.git \
  49 | >>>     && cd monero \
  50 | >>>     && test -z "$NPROC" && nproc > /nproc || echo -n "$NPROC" > /nproc && make -j"$(cat /nproc)"
  51 |
--------------------
ERROR: failed to solve: process "/bin/sh -c git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-project/monero.git     && cd monero     && test -z \"$NPROC\" && nproc > /nproc || echo -n \"$NPROC\" > /nproc && make -j\"$(cat /nproc)\"" did not complete successfully: exit code: 2
moneroexamples commented 7 months ago

Is it master or devel branch?

meglio commented 7 months ago

master

moneroexamples commented 7 months ago

I just run docker build --no-cache --build-arg NPROC=2 -t xmrblocks . (I use 2 CPUS only on PC, not mac) on the master branch, and had issues. The error is from compiling monero, maybe it has been fixed by now? Have you tried recently?

DaWe35 commented 6 months ago

I have similar issues building on a Debian host (tried multiple times with one and more CPUs). Is this a monero problem? Is it possible to use precompiled monerod?

1709.3 [ 57%] Building CXX object src/rpc/CMakeFiles/obj_daemon_messages.dir/message.cpp.o
1719.8 [ 57%] Building CXX object src/rpc/CMakeFiles/obj_daemon_messages.dir/daemon_messages.cpp.o
1741.4 make[3]: Leaving directory '/root/monero/build/release'
1741.5 [ 57%] Built target obj_daemon_messages
1741.5 make[3]: Entering directory '/root/monero/build/release'
1741.5 Scanning dependencies of target daemon_messages
1741.5 make[3]: Leaving directory '/root/monero/build/release'
1741.5 make[3]: Entering directory '/root/monero/build/release'
1741.5 [ 57%] Linking CXX static library libdaemon_messages.a
1741.6 make[3]: Leaving directory '/root/monero/build/release'
1741.6 [ 57%] Built target daemon_messages
1741.6 make[3]: Entering directory '/root/monero/build/release'
1741.6 Scanning dependencies of target daemon_rpc_server
1741.6 make[3]: Leaving directory '/root/monero/build/release'
1741.6 make[3]: Entering directory '/root/monero/build/release'
1741.7 [ 57%] Linking CXX static library libdaemon_rpc_server.a
1741.7 make[3]: Leaving directory '/root/monero/build/release'
1741.8 [ 57%] Built target daemon_rpc_server
1741.8 make[3]: Entering directory '/root/monero/build/release'
1741.9 Scanning dependencies of target obj_device_trezor
1741.9 make[3]: Leaving directory '/root/monero/build/release'
1741.9 make[3]: Entering directory '/root/monero/build/release'
1741.9 [ 57%] Building CXX object src/device_trezor/CMakeFiles/obj_device_trezor.dir/device_trezor.cpp.o
1746.6 make[3]: Leaving directory '/root/monero/build/release'
1746.6 [ 57%] Built target obj_device_trezor
1746.6 make[3]: Entering directory '/root/monero/build/release'
1746.7 Scanning dependencies of target device_trezor
1746.7 make[3]: Leaving directory '/root/monero/build/release'
1746.7 make[3]: Entering directory '/root/monero/build/release'
1746.7 [ 57%] Linking CXX static library libdevice_trezor.a
1746.7 make[3]: Leaving directory '/root/monero/build/release'
1746.8 [ 57%] Built target device_trezor
1746.8 make[3]: Entering directory '/root/monero/build/release'
1746.9 Scanning dependencies of target obj_wallet
1746.9 make[3]: Leaving directory '/root/monero/build/release'
1746.9 make[3]: Entering directory '/root/monero/build/release'
1747.0 [ 58%] Building CXX object src/wallet/CMakeFiles/obj_wallet.dir/wallet2.cpp.o
1764.5 /root/monero/src/wallet/wallet2.cpp: In member function 'void tools::wallet2::refresh(bool, uint64_t, uint64_t&, bool&, bool, bool, uint64_t)':
1764.5 /root/monero/src/wallet/wallet2.cpp:3974:8: warning: unused variable 'refreshed' [-Wunused-variable]
1764.5  3974 |   bool refreshed = false;
1764.5       |        ^~~~~~~~~
3056.9 c++: fatal error: Killed signal terminated program cc1plus
3056.9 compilation terminated.
3056.9 make[3]: *** [src/wallet/CMakeFiles/obj_wallet.dir/build.make:63: src/wallet/CMakeFiles/obj_wallet.dir/wallet2.cpp.o] Error 1
3056.9 make[3]: Leaving directory '/root/monero/build/release'
3056.9 make[2]: *** [CMakeFiles/Makefile2:3561: src/wallet/CMakeFiles/obj_wallet.dir/all] Error 2
3056.9 make[2]: Leaving directory '/root/monero/build/release'
3056.9 make[1]: Leaving directory '/root/monero/build/release'
3056.9 make[1]: *** [Makefile:141: all] Error 2
3057.0 make: *** [Makefile:103: release-all] Error 2
------
failed to solve: process "/bin/sh -c git clone --recursive --branch ${MONERO_BRANCH} https://github.com/monero-project/monero.git     && cd monero     && USE_SINGLE_BUILDDIR=1 make" did not complete successfully: exit code: 2

Edit: I was running out of memory, so I downloaded more RAM and built successfully. I published the docker image here: https://hub.docker.com/r/dawe35/xmrblocks/general