OrchidTechnologies / orchid

Orchid: VPN, Personal Firewall
https://www.orchid.com/
GNU Affero General Public License v3.0
649 stars 103 forks source link

Docker build error: Error 137 #104

Closed nemcikjan closed 2 years ago

nemcikjan commented 2 years ago

Describe the bug When trying to build docker image getting following error: `

12 2812.5 59117 Killed | /usr/local/lib/android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --gcc-toolchain=/usr/src/orchid/srv-shared/out-lnx/sysroot/usr --sysroot /usr/src/orchid/srv-shared/out-lnx/sysroot -B/usr/local/lib/android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/x86_64-linux-android/bin -target x86_64-linux-gnu -MD -MP -c -o out-lnx/x86_64/./p2p/source/base.cpp.o -std=c++2a -gfull -Os -fno-omit-frame-pointer -fdata-sections -ffunction-sections -fvisibility=hidden -fPIC -fdebug-prefix-map=/usr/local/lib/android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64=out-lnx/ndk -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -fdebug-prefix-map=./= -fdebug-prefix-map=/usr/src/orchid/srv-shared=. -fno-ident -DCHROMIUM_ZLIB_NO_CHROMECONF -Iout-lnx/x86_64/usr/include -Iout-lnx/extra -Iout-lnx/x86_64/extra -I./extra -I./source -I./p2p/extra -I./p2p/cppcoro/include -I./p2p/source -I./p2p/expected/include -I./p2p/url/include -I./p2p/url/src -I./p2p/lwip/contrib/ports/unix/port/include -I./p2p/lwip/src/include -I./p2p/BeastHttp/BeastHttp/include -I./p2p/ctre/single-header -I./p2p/jsoncpp/include -I./p2p/SHA3IUF -I./p2p/libutp -I./p2p/secp256k1/include -I./p2p/intx/include -I./p2p/fmt/include -I./p2p/eEVM/3rdparty -I./p2p/eEVM/include -I./p2p/challenge-bypass-ristretto-ffi/src -I./p2p/boringtun/src -I./p2p/SPCDNS/src -I./p2p/cpp-jwt/include -I./p2p/bech32/ref/c++ -I./p2p/pugixml/src -I./p2p/snappy -I./p2p/boost/libs/algorithm/include -I./p2p/boost/libs/align/include -I./p2p/boost/libs/any/include -I./p2p/boost/libs/array/include -I./p2p/boost/libs/asio/include -I./p2p/boost/libs/assert/include -I./p2p/boost/libs/beast/include -I./p2p/boost/libs/bind/include -I./p2p/boost/libs/concept_check/include -I./p2p/boost/libs/config/include -I./p2p/boost/libs/container/include -I./p2p/boost/libs/container_hash/include -I./p2p/boost/libs/core/include -I./p2p/boost/libs/date_time/include -I./p2p/boost/libs/detail/include -I./p2p/boost/libs/endian/include -I./p2p/boost/libs/exception/include -I./p2p/boost/libs/filesystem/include -I./p2p/boost/libs/foreach/include -I./p2p/boost/libs/format/include -I./p2p/boost/libs/function/include -I./p2p/boost/libs/function_types/include -I./p2p/boost/libs/fusion/include -I./p2p/boost/libs/integer/include -I./p2p/boost/libs/intrusive/include -I./p2p/boost/libs/io/include -I./p2p/boost/libs/iterator/include -I./p2p/boost/libs/json/include -I./p2p/boost/libs/lexical_cast/include -I./p2p/boost/libs/logic/include -I./p2p/boost/libs/math/include -I./p2p/boost/libs/move/include -I./p2p/boost/libs/mp11/include -I./p2p/boost/libs/mpl/include -I./p2p/boost/libs/multi_index/include -I./p2p/boost/libs/multiprecision/include -I./p2p/boost/libs/optional/include -I./p2p/boost/libs/parameter/include -I./p2p/boost/libs/predef/include -I./p2p/boost/libs/preprocessor/include -I./p2p/boost/libs/process/include -I./p2p/boost/libs/program_options/include -I./p2p/boost/libs/property_tree/include -I./p2p/boost/libs/random/include -I./p2p/boost/libs/range/include -I./p2p/boost/libs/rational/include -I./p2p/boost/libs/regex/include -I./p2p/boost/libs/serialization/include -I./p2p/boost/libs/signals2/include -I./p2p/boost/libs/smart_ptr/include -I./p2p/boost/libs/static_assert/include -I./p2p/boost/libs/system/include -I./p2p/boost/libs/throw_exception/include -I./p2p/boost/libs/tokenizer/include -I./p2p/boost/libs/tti/include -I./p2p/boost/libs/tuple/include -I./p2p/boost/libs/type_index/include -I./p2p/boost/libs/type_traits/include -I./p2p/boost/libs/utility/include -I./p2p/boost/libs/uuid/include -I./p2p/boost/libs/variant/include -I./p2p/boost/libs/winapi/include -I./p2p/boost/libs/numeric/interval/include -I./p2p/boost/libs/numeric/conversion/include -I./p2p/boost/libs/numeric/odeint/include -I./p2p/boost/libs/numeric/ublas/include -I./p2p/outcome/include -I./p2p/boost/libs/asio/include/boost -I./p2p/protobuf/src -Iout-lnx/pb -I./p2p/rtc/extra -I./p2p/rtc/webrtc -I./p2p/rtc/abseil-cpp -I./p2p/rtc/libsrtp/include -I./p2p/rtc/libsrtp/crypto/include -I./p2p/rtc/usrsctp -I./p2p/rtc/usrsctp/usrsctplib -I./p2p/rtc/sctp-idata/src -I./p2p/rtc/openssl/include -I./p2p/rtc/openssl/test/ossl_shim/include -Iout-lnx/x86_64/openssl/include -I./p2p/krypton/extra -Iout-lnx/x86_64/./p2p/./c-ares/include -I./p2p/./c-ares/include -I./p2p/./lz4/lib -I./p2p/./openvpn3 -I./p2p/./openvpn3/client -Iout-lnx/./p2p/. -I./cv8/icu/extra/{common,i18n} -I./cv8/zlb/libz -I./cv8/zlb/extra -I./cv8/zlb -I./cv8/v8 -Iout-lnx/./cv8/v8 -I./cv8/v8/include -I./cv8/v8/src -I./cv8/extra -Iall/vpn-shared/source -Iall/vpn-linux/source -I./libuv/include -I./json/include/nlohmann -I./json/include -I./mediasoup/worker/include -I./mediasoup/worker/deps/netstring/netstring-c -I./di/include -I./GSL/include -I./hat-trie/include -I./sqlite_modern_cpp/hdr -I./yaml-cpp/include -I./soralog/include -I./cpp-libp2p/include -Iout-lnx/pb/generated -DNDEBUG -D_FORTIFY_SOURCE=2 -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -Wall -Werror -Wno-unknown-warning-option -Wno-deprecated-volatile -Wno-range-loop-analysis -fmessage-length=0 -ferror-limit=0 -ftemplate-backtrace-limit=0 -Wno-bitwise-op-parentheses -Wno-dangling-else -Wno-empty-body -Wno-logical-op-parentheses -Wno-misleading-indentation -Wno-missing-selector-name -Wno-overloaded-shift-op-parentheses -Wno-potentially-evaluated-expression -Wno-tautological-constant-out-of-range-compare -Wno-tautological-overlap-compare -fcoroutines-ts -DLWIP_ERRNO_STDINCLUDE -Wno-deprecated-declarations -DPOSIX=5 -DENABLE_MODULE_RECOVERY -DENABLE_MODULE_ECDH -DUSE_ECMULT_STATIC_PRECOMPUTATION -DUSE_FIELD_INV_BUILTIN -DUSE_NUM_NONE -DUSE_SCALAR_INV_BUILTIN -DECMULT_WINDOW_SIZE=15 -DECMULT_GEN_PREC_BITS=4 -DPUGIXML_HAS_LONG_LONG -DBOOST_ASIO_DISABLE_CONNECTEX -DHAVE_PTHREAD -DWEBRTC_HAVE_SCTP -DWEBRTC_HAVE_DCSCTP -DWEBRTC_HAVE_USRSCTP -DABSL_ALLOCATOR_NOTHROW=0 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_OPUS_SUPPORT_120MS_PTIME=0 -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_UINT8_T -DHAVE_UINT16_T -DHAVE_INT32_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DPACKAGE_STRING='""' -DPACKAGE_VERSION='"1.6.0"' -DUserspace -DSCTP_DEBUG -DSCTP_PROCESS_LEVEL_LOCKS -DSCTP_SIMPLE_ALLOCATOR -DSCTP_STDINT_INCLUDE='' -DSCTP_USE_OPENSSL_SHA1 -DWEBRTC_POSIX -DWEBRTC_LINUX -DHAVE_NETINET_IN_H -DCARES_STATICLIB -DUSE_ASIO -DUSE_ASIO_THREADLOCAL -DASIO_NO_DEPRECATED -DHAVE_LZ4 -DUSE_OPENSSL -DOPENVPN_FORCE_TUN_NULL -DUSE_TUN_BUILDER -DOPENVPN_EXTERNAL_TRANSPORT_FACTORY -DOPENVPN_EXTERNAL_TUN_FACTORY -DSQLITE_DQS=0 -DSQLITE_ENABLE_RTREE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_TCL_VARIABLE -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_LINUX -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DOFFICIAL_BUILD -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DOBJECT_PRINT -DENABLE_HANDLE_ZAPPING -DENABLE_MINOR_MC -DVERIFY_HEAP -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_ATOMIC_MARKING_STATE -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_COMPRESS_POINTERS -DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE -DV8_DEPRECATION_WARNINGS -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_ENABLE_WEBASSEMBLY -DV8_IMMINENT_DEPRECATION_WARNINGS -DV8_INTL_SUPPORT -DV8_SNAPSHOT_COMPRESSION -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DV8_WIN64_UNWINDING_INFO -DUCHAR_TYPE=uint16_t -DU_SHOW_INTERNAL_API -mno-ms-bitfields -DMS_LITTLE_ENDIAN -DMS_LOG_STD -DMS_LOG_TRACE -nostdinc++ -isystem /usr/src/orchid/srv-shared/./env/libcxx/include -isystem /usr/src/orchid/srv-shared/./env/libcxxabi/include -iquotep2p/source/ -x c++ -

12 2812.5 make: *** [env/output.mk:67: out-lnx/x86_64/./p2p/source/base.cpp.o] Error 137

`

To Reproduce Steps to reproduce the behavior:

  1. Open Terminal
  2. Go to srv-docker folder
  3. Run docker build -t orchid .
  4. See error (error occurred after 2812 secs of build process)

Expected behavior Successfull build of docker image

Device information:

saurik commented 2 years ago

The process was killed and exited with error 137, which almost always means you ran out of memory. You could maybe reduce the parallelization in the Dockerfile from -j3 to -j1, though I'm betting the "core problem" is actually restrictive local Docker resource allocation settings (which I won't be able to help you with).

Regardless: you are building on a Mac... are you intending to run this binary on the Mac? If so, the Docker build is going to be almost comically horrible: Docker on a Mac is almost unusably slow :/... you should use the makefile in the srv-shared folder to do a native build with official tooling to get a real macOS binary.