zeromq / zeromq.js

:zap: Node.js bindings to the ØMQ library
http://zeromq.github.io/zeromq.js/
MIT License
1.48k stars 210 forks source link

Alpine instalation is failling #303

Closed pjanuario closed 5 years ago

pjanuario commented 5 years ago

I am trying to build a alpine image with zeromq library installed without much success, I used the same approach that I was using before with zmq module.

I also tried some other alternatives as described in the documentation without much success, can someone give a hint here:

$ docker build . -t test:10-alpine
Sending build context to Docker daemon  3.186MB
Step 1/10 : FROM node:10-alpine
 ---> fe6ff768f798
Step 2/10 : ENV APP_DIR=/app
 ---> Running in dc700a5a009f
Removing intermediate container dc700a5a009f
 ---> aadcc3746a5d
Step 3/10 : COPY package.json $APP_DIR/
 ---> 206af67c0a64
Step 4/10 : RUN chown -R node:node $APP_DIR/*
 ---> Running in fb01f4ba1fde
Removing intermediate container fb01f4ba1fde
 ---> 89b3b9929413
Step 5/10 : WORKDIR $APP_DIR
 ---> Running in 383d0ee1cf67
Removing intermediate container 383d0ee1cf67
 ---> d4f79dd0d678
Step 6/10 : RUN apk add --no-cache make gcc g++ python zeromq zeromq-dev
 ---> Running in d8c9ab19eca7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/27) Installing binutils (2.30-r5)
(2/27) Installing gmp (6.1.2-r1)
(3/27) Installing isl (0.18-r0)
(4/27) Installing libgomp (6.4.0-r9)
(5/27) Installing libatomic (6.4.0-r9)
(6/27) Installing pkgconf (1.5.3-r0)
(7/27) Installing mpfr3 (3.1.5-r1)
(8/27) Installing mpc1 (1.0.3-r1)
(9/27) Installing gcc (6.4.0-r9)
(10/27) Installing musl-dev (1.1.19-r10)
(11/27) Installing libc-dev (0.7.1-r0)
(12/27) Installing g++ (6.4.0-r9)
(13/27) Installing make (4.2.1-r2)
(14/27) Installing libbz2 (1.0.6-r6)
(15/27) Installing expat (2.2.5-r0)
(16/27) Installing libffi (3.2.1-r4)
(17/27) Installing gdbm (1.13-r1)
(18/27) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(19/27) Installing ncurses-terminfo (6.1_p20180818-r1)
(20/27) Installing ncurses-libs (6.1_p20180818-r1)
(21/27) Installing readline (7.0.003-r0)
(22/27) Installing sqlite-libs (3.25.3-r0)
(23/27) Installing python2 (2.7.15-r1)
(24/27) Installing libsodium (1.0.16-r0)
(25/27) Installing libzmq (4.2.5-r0)
(26/27) Installing zeromq (4.2.5-r0)
(27/27) Installing zeromq-dev (4.2.5-r0)
Executing busybox-1.28.4-r3.trigger
OK: 210 MiB in 42 packages
Removing intermediate container d8c9ab19eca7
 ---> f190f366fc54
Step 7/10 : RUN npm install
 ---> Running in e9a958c22ce8

> zeromq@5.1.0 install /app/node_modules/zeromq
> node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)

prebuild-install WARN install No prebuilt binaries found (target=10.15.1 runtime=node arch=x64 platform=linux)

Building libzmq for linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... none
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether C compiler accepts -std=gnu11... yes
checking for g++... g++
./configure: ./configure.lineno: line 5201: CFLAGS+= -std=gnu11: not found
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++11 features by default... yes
checking for a sed that does not truncate output... /bin/sed
checking whether to build with code coverage support... no
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gawk... (cached) awk
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for xmlto... no
checking for asciidoc... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-alpine-linux-musl/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
./configure: ./configure.lineno: line 1: /usr/bin/file: not found
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-alpine-linux-musl/bin/ld
checking if the linker (/usr/x86_64-alpine-linux-musl/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-alpine-linux-musl/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for valgrind... no
checking whether the C compiler works... yes
checking whether we are using Intel C compiler... no
checking whether we are using Sun Studio C compiler... no
checking whether we are using clang C compiler... no
checking whether we are using gcc >= 4 C compiler... yes
checking whether the C++ compiler works... yes
checking whether we are using Intel C++ compiler... no
checking whether we are using Sun Studio C++ compiler... no
checking whether we are using clang C++ compiler... no
checking whether we are using gcc >= 4 C++ compiler... yes
checking whether to enable debugging information... no
checking whether to enable code coverage... no
checking if TIPC is available and supports nonblocking connect... no
checking for library containing dladdr... none required
checking for pthread_create in -lpthread... yes
checking for clock_gettime in -lrt... yes
checking whether C++ compiler supports -fvisibility=hidden... yes
checking whether C++ compiler supports dso visibility... yes
checking whether to build documentation... no
checking whether to install manpages... no
configure: Choosing polling system from 'kqueue epoll devpoll pollset poll select'...
configure: Using 'epoll' polling system with CLOEXEC
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/eventfd.h usability... yes
checking sys/eventfd.h presence... yes
checking for sys/eventfd.h... yes
checking whether EFD_CLOEXEC is supported... yes
checking whether SO_PEERCRED is declared... yes
checking whether LOCAL_PEERCRED is declared... no
checking for stdbool.h that conforms to C99... no
checking for _Bool... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for working volatile... yes
configure: Using tweetnacl for CURVE security
checking "with_norm_ext = no"... no
checking how to enable additional warnings for C++ compiler... -Wall
checking how to turn warnings to errors in C++ compiler... -Werror
checking whether compiler supports __atomic_Xxx intrinsics... yes
checking return type of signal handlers... void
checking for perror... yes
checking for gettimeofday... yes
checking for clock_gettime... yes
checking for memset... yes
checking for socket... yes
checking for getifaddrs... yes
checking for freeifaddrs... yes
checking for fork... yes
checking for posix_memalign... yes
checking for mkdtemp... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking whether SOCK_CLOEXEC is supported... yes
checking whether SO_KEEPALIVE is supported... yes
checking whether TCP_KEEPCNT is supported... yes
checking whether TCP_KEEPIDLE is supported... yes
checking whether TCP_KEEPINTVL is supported... yes
checking whether TCP_KEEPALIVE is supported... no
checking for ./.git... no
configure: Building stable and legacy API (no draft API)
checking for LIBUNWIND... no
configure: WARNING: Cannot find libunwind
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/libzmq.pc
config.status: creating doc/Makefile
config.status: creating builds/Makefile
config.status: creating builds/msvc/Makefile
config.status: creating src/platform.hpp
config.status: executing depfiles commands
config.status: executing libtool commands
Making all in doc
make[1]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[1]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
  CXX      src/src_libzmq_la-address.lo
  CXX      src/src_libzmq_la-client.lo
  CXX      src/src_libzmq_la-clock.lo
  CXX      src/src_libzmq_la-ctx.lo
  CXX      src/src_libzmq_la-curve_client.lo
  CXX      src/src_libzmq_la-curve_server.lo
  CXX      src/src_libzmq_la-dealer.lo
  CXX      src/src_libzmq_la-devpoll.lo
  CXX      src/src_libzmq_la-dgram.lo
  CXX      src/src_libzmq_la-dish.lo
  CXX      src/src_libzmq_la-dist.lo
  CXX      src/src_libzmq_la-epoll.lo
  CXX      src/src_libzmq_la-err.lo
  CXX      src/src_libzmq_la-fq.lo
  CXX      src/src_libzmq_la-gather.lo
  CXX      src/src_libzmq_la-gssapi_mechanism_base.lo
  CXX      src/src_libzmq_la-gssapi_client.lo
  CXX      src/src_libzmq_la-gssapi_server.lo
  CXX      src/src_libzmq_la-io_object.lo
  CXX      src/src_libzmq_la-io_thread.lo
  CXX      src/src_libzmq_la-ip.lo
  CXX      src/src_libzmq_la-ipc_address.lo
  CXX      src/src_libzmq_la-ipc_connecter.lo
  CXX      src/src_libzmq_la-ipc_listener.lo
  CXX      src/src_libzmq_la-kqueue.lo
  CXX      src/src_libzmq_la-lb.lo
  CXX      src/src_libzmq_la-mailbox.lo
  CXX      src/src_libzmq_la-mailbox_safe.lo
  CXX      src/src_libzmq_la-mechanism.lo
  CXX      src/src_libzmq_la-metadata.lo
  CXX      src/src_libzmq_la-msg.lo
  CXX      src/src_libzmq_la-mtrie.lo
  CXX      src/src_libzmq_la-norm_engine.lo
  CXX      src/src_libzmq_la-null_mechanism.lo
  CXX      src/src_libzmq_la-object.lo
  CXX      src/src_libzmq_la-options.lo
  CXX      src/src_libzmq_la-own.lo
  CXX      src/src_libzmq_la-pair.lo
  CXX      src/src_libzmq_la-pgm_receiver.lo
  CXX      src/src_libzmq_la-pgm_sender.lo
  CXX      src/src_libzmq_la-pgm_socket.lo
  CXX      src/src_libzmq_la-pipe.lo
  CXX      src/src_libzmq_la-plain_client.lo
  CXX      src/src_libzmq_la-plain_server.lo
  CXX      src/src_libzmq_la-poll.lo
  CXX      src/src_libzmq_la-poller_base.lo
  CXX      src/src_libzmq_la-pollset.lo
  CXX      src/src_libzmq_la-precompiled.lo
  CXX      src/src_libzmq_la-proxy.lo
  CXX      src/src_libzmq_la-pub.lo
  CXX      src/src_libzmq_la-pull.lo
  CXX      src/src_libzmq_la-push.lo
  CXX      src/src_libzmq_la-radio.lo
  CXX      src/src_libzmq_la-random.lo
  CXX      src/src_libzmq_la-raw_decoder.lo
  CXX      src/src_libzmq_la-raw_encoder.lo
  CXX      src/src_libzmq_la-reaper.lo
  CXX      src/src_libzmq_la-rep.lo
  CXX      src/src_libzmq_la-req.lo
  CXX      src/src_libzmq_la-router.lo
  CXX      src/src_libzmq_la-scatter.lo
  CXX      src/src_libzmq_la-select.lo
  CXX      src/src_libzmq_la-server.lo
  CXX      src/src_libzmq_la-session_base.lo
  CXX      src/src_libzmq_la-signaler.lo
  CXX      src/src_libzmq_la-socket_base.lo
  CXX      src/src_libzmq_la-socks.lo
  CXX      src/src_libzmq_la-socks_connecter.lo
  CXX      src/src_libzmq_la-stream.lo
  CXX      src/src_libzmq_la-stream_engine.lo
  CXX      src/src_libzmq_la-sub.lo
  CXX      src/src_libzmq_la-tcp.lo
  CXX      src/src_libzmq_la-tcp_address.lo
  CXX      src/src_libzmq_la-tcp_connecter.lo
  CXX      src/src_libzmq_la-tcp_listener.lo
  CXX      src/src_libzmq_la-thread.lo
  CXX      src/src_libzmq_la-timers.lo
  CXX      src/src_libzmq_la-tipc_address.lo
  CXX      src/src_libzmq_la-tipc_connecter.lo
  CXX      src/src_libzmq_la-tipc_listener.lo
  CXX      src/src_libzmq_la-trie.lo
  CXX      src/src_libzmq_la-udp_address.lo
  CXX      src/src_libzmq_la-udp_engine.lo
  CXX      src/src_libzmq_la-v1_decoder.lo
  CXX      src/src_libzmq_la-v2_decoder.lo
  CXX      src/src_libzmq_la-v1_encoder.lo
  CXX      src/src_libzmq_la-v2_encoder.lo
  CXX      src/src_libzmq_la-vmci.lo
  CXX      src/src_libzmq_la-vmci_address.lo
  CXX      src/src_libzmq_la-vmci_connecter.lo
  CXX      src/src_libzmq_la-vmci_listener.lo
  CXX      src/src_libzmq_la-xpub.lo
  CXX      src/src_libzmq_la-xsub.lo
  CXX      src/src_libzmq_la-zmq.lo
  CXX      src/src_libzmq_la-zmq_utils.lo
  CXX      src/src_libzmq_la-decoder_allocators.lo
  CXX      src/src_libzmq_la-socket_poller.lo
  CC       src/src_libzmq_la-tweetnacl.lo
  CXX      tools/curve_keygen.o
  CXX      perf/local_lat.o
  CXX      perf/remote_lat.o
  CXX      perf/local_thr.o
  CXX      perf/remote_thr.o
  CXX      perf/inproc_lat.o
  CXX      perf/inproc_thr.o
  CXXLD    src/libzmq.la
ar: `u' modifier ignored since `D' is the default (see `U')
  CXXLD    tools/curve_keygen
  CXXLD    perf/local_lat
  CXXLD    perf/remote_lat
  CXXLD    perf/local_thr
  CXXLD    perf/remote_thr
  CXXLD    perf/inproc_lat
  CXXLD    perf/inproc_thr
make[1]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
Making install in doc
make[1]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[2]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[1]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2/doc'
make[1]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
make[2]: Entering directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
 config/install-sh -c -d '/app/node_modules/zeromq/scripts/../zmq/lib'
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   src/libzmq.la '/app/node_modules/zeromq/scripts/../zmq/lib'
libtool: install: /usr/bin/install -c src/.libs/libzmq.lai /app/node_modules/zeromq/scripts/../zmq/lib/libzmq.la
libtool: install: /usr/bin/install -c src/.libs/libzmq.a /app/node_modules/zeromq/scripts/../zmq/lib/libzmq.a
libtool: install: chmod 644 /app/node_modules/zeromq/scripts/../zmq/lib/libzmq.a
libtool: install: ranlib /app/node_modules/zeromq/scripts/../zmq/lib/libzmq.a
libtool: finish: PATH="/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/app/node_modules/zeromq/node_modules/.bin:/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /app/node_modules/zeromq/scripts/../zmq/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /app/node_modules/zeromq/scripts/../zmq/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 config/install-sh -c -d '/app/node_modules/zeromq/scripts/../zmq/bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c tools/curve_keygen '/app/node_modules/zeromq/scripts/../zmq/bin'
libtool: install: /usr/bin/install -c tools/curve_keygen /app/node_modules/zeromq/scripts/../zmq/bin/curve_keygen
 config/install-sh -c -d '/app/node_modules/zeromq/scripts/../zmq/include'
 /usr/bin/install -c -m 644 include/zmq.h include/zmq_utils.h '/app/node_modules/zeromq/scripts/../zmq/include'
 config/install-sh -c -d '/app/node_modules/zeromq/scripts/../zmq/lib/pkgconfig'
 /usr/bin/install -c -m 644 src/libzmq.pc '/app/node_modules/zeromq/scripts/../zmq/lib/pkgconfig'
make[2]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
make[1]: Leaving directory '/app/node_modules/zeromq/zmq/zeromq-4.2.2'
Succesfully build libzmq on Thu Feb 07 2019 15:22:58 GMT+0000 (Coordinated Universal Time)
make: Entering directory '/app/node_modules/zeromq/build'
  CXX(target) Release/obj.target/zmq/binding.o
../binding.cc: In member function 'void zmq::Socket::NotifyReadReady()':
../binding.cc:399:73: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(this->handle(), callback_v.As<Function>(), 0, NULL);
                                                                         ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
../binding.cc: In member function 'void zmq::Socket::NotifySendReady()':
../binding.cc:407:73: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(this->handle(), callback_v.As<Function>(), 0, NULL);
                                                                         ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
../binding.cc: In member function 'void zmq::Socket::MonitorEvent(uint16_t, int32_t, char*)':
../binding.cc:458:73: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(this->handle(), callback_v.As<Function>(), 4, argv);
                                                                         ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
../binding.cc: In member function 'void zmq::Socket::MonitorError(const char*)':
../binding.cc:473:73: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(this->handle(), callback_v.As<Function>(), 1, argv);
                                                                         ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
../binding.cc: In static member function 'static void zmq::Socket::UV_BindAsyncAfter(uv_work_t*)':
../binding.cc:814:70: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(Nan::GetCurrentContext()->Global(), cb, 1, argv);
                                                                      ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
../binding.cc: In static member function 'static void zmq::Socket::UV_UnbindAsyncAfter(uv_work_t*)':
../binding.cc:893:70: warning: 'v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)' is deprecated [-Wdeprecated-declarations]
     Nan::MakeCallback(Nan::GetCurrentContext()->Global(), cb, 1, argv);
                                                                      ^
In file included from ../binding.cc:40:0:
../../nan/nan.h:959:46: note: declared here
   NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
                                              ^~~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/zmq.node
  COPY Release/zmq.node
make: Leaving directory '/app/node_modules/zeromq/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN docker@1.0.0 No description
npm WARN docker@1.0.0 No repository field.

added 64 packages from 44 contributors and audited 109 packages in 40.425s
found 0 vulnerabilities

Removing intermediate container e9a958c22ce8
 ---> a09984873e58
Step 8/10 : USER node
 ---> Running in 66635807ff05
Removing intermediate container 66635807ff05
 ---> 1400e666e3ea
Step 9/10 : ADD . $APP_DIR
 ---> 5d1ab33976d2
Step 10/10 : EXPOSE 3000
 ---> Running in 3cfe235947b5
Removing intermediate container 3cfe235947b5
 ---> 8b7c9b114a50
Successfully built 8b7c9b114a50
Successfully tagged test:10-alpine

After this build that gives does errors the container is still built and if try to run a example app it will give the following error:

$ docker run test:10-alpine node worker.js
internal/modules/cjs/loader.js:718
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: Error loading shared library /app/node_modules/zeromq/build/Release/zmq.node: Exec format error
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/app/node_modules/zeromq/lib/index.js:6:11)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

Any clue?

pjanuario commented 5 years ago

Dockerfile

FROM node:10-alpine

ENV APP_DIR=/app

COPY package.json $APP_DIR/
RUN chown -R node:node $APP_DIR/*

WORKDIR $APP_DIR

RUN apk add --no-cache make gcc g++ python zeromq zeromq-dev
RUN npm install

USER node

ADD . $APP_DIR

EXPOSE 3000
pjanuario commented 5 years ago

I was able to build the image, it was a silly mistake related with node modules being included in the image and the fact that red warnings were appearing.

rudolph9 commented 5 years ago

@pjanuario why did you install the apks zeromq zeromq-dev rather than just doing npm install zeromq and relying on npm install to build what is needed.

pjanuario commented 5 years ago

@rudolph9 because alpine binaries are not available.

swateek commented 4 years ago

I am still facing this issue even though I included all binaries that you have added to your alpine image. Anything else you might have done extra?