GithubHelp home page GithubHelp logo

alpine-node's People

Contributors

dalisoft avatar jakxz avatar mhart avatar qix- avatar rudijs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alpine-node's Issues

Add alpine:edge tag

Heya!

It would be great to have the edge base alpine tag to chose from this repo tags so we can get the latest Alpine (we need some fixes from 3.4 here, not yet published but in edge)

Use Docker Automated Builds

Hi,
thanks for the great alpine based node image. Would you mind to use docker automated builds for your images to make the integrity verifiable? That would be really nice. If you don't want to, I would fork the project and do it on my own. I just wanted to let you know and choose your way to do it.

node-gyp needs build tools

node-gyp, which is often used by packages installed through npm (at least that is my experience), needs python, make, and gcc. Would it make sense not to clean those up? (Currently happening in line 36 of the Dockerfile)

Cannot find module nan when compiling native modules in 6.3.0

Upgrading to node 6.3.0 and I'm oddly not able to build native modules anymore. I am able to compile them fine locally (I'm using nvm) so I'm not sure if it's docker or node or npm or whatever, but this seems like the most appropriate place to start!

I've got an example for you at https://github.com/toddself/alpine-node-test

This works like a charm: docker build -f Dockerfile-4 . (FROM mhart/alpine-node:4)
This fails: docker build -f Dockerfile-6 . (FROM mhart/alpine-node:6)

Error is as follows:

> [email protected] install /node_modules/libpq
> node-gyp rebuild

module.js:442
    throw err;
    ^

Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at [eval]:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:25:33)
    at Object.exports.runInThisContext (vm.js:77:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:541:32)
    at bootstrap_node.js:315:29
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.0-28-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/libpq
gyp ERR! node -v v6.3.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

[bunch of crap excised]

npm ERR! Linux 4.4.0-28-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the libpq package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs libpq
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls libpq
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Cannot dynamically link compiled modules

Summary

Native modules that use dynamic linking cannot be used. This may be related to the --fully-static arg used during compiling.

Steps to reproduce

  1. npm install bcrypt
  2. require('bcrypt');

Expected results

Module is required and available to use.

Actual results

Error is thrown:

/app/node_modules/bindings/bindings.js:83
    throw e
    ^
Error: Dynamic loading not supported
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at bindings (/app/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/app/models/user.js:6:37)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)

compile error vfvp2 on ARM architecture(+fix)

Hi,

I tried to get this dockerfile crosscompiled on ARM as well, but got errors.
This seems to fix it:

coderofsalvation@71ff95b

It seems nodejs needs --without-snapshot and vfvp3 as a minimum, otherwise it crashes on ARM
Not sure if and how we should merge this.
In any case, people who want it can grab the dockerfile here:

https://github.com/coderofsalvation/alpine-node-arm

or the precompiled tarball here:

https://github.com/coderofsalvation/alpine-node-arm/raw/master/node-v4.1.1-armhf-alpinelinux.tar.gz

purpose of paxctl?

Wondering what the purpose of the paxctl -cm line is in the installation.

Node process does not abort when it is out of memory

My node process does not exit (aborted) when it is out of memory. Instead it just prints

<--- Last few GCs --->

    1095 ms: Mark-sweep 27.4 (62.7) -> 21.2 (59.4) MB, 33.0 / 0 ms (+ 5.5 ms in 42 steps since start of marking, biggest step 0.4 ms) [allocation failure] [GC in old space requested].
    1114 ms: Mark-sweep 21.2 (59.4) -> 21.2 (59.4) MB, 19.1 / 0 ms [allocation failure] [GC in old space requested].
    1132 ms: Mark-sweep 21.2 (59.4) -> 20.9 (59.4) MB, 17.6 / 0 ms [last resort gc].
    1149 ms: Mark-sweep 20.9 (59.4) -> 20.9 (59.4) MB, 17.5 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1767b25c9e59 <JS Object>
    2: _repeat [/usr/src/app/memory.js:~10] [pc=0x54102d5f9b1] (this=0x3cc32928c999 <a Timeout with map 0x34877b623bb1>)
    3: _onTimeout(aka wrapper) [timers.js:417] [pc=0x54102d5d7b3] (this=0x3cc32928c999 <a Timeout with map 0x34877b623bb1>)
    4: tryOnTimeout(aka tryOnTimeout) [timers.js:224] [pc=0x54102d5d4e3] (this=0x1767b2504189 <undefined>,timer=0x3cc32928c999 <a Timeout with map 0x348...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

and then starts using 100% CPU.
This is a serious safety issue. Is this expected due to difference with glibc and musl?

When I try it with node:argon container exits as expected after printing the same information as above.

To mimic the behaviour, I have created a Dockerfile and a js file that leaks memory:
memory.zip

Updating npm in 5.9 to allow production installs

So I ran into this issue npm/npm#11699 in version 5.8 and 5.9 of the container as node is still packaging npm 3.8.0 and this was fixed in 3.8.1.

Obviously I when I tried to update npm I ran into npm/npm#9863

However when I tried the solution there I could not install fs-extra into the npm directory due to
npm/npm#10686

So I finally came up with this line in my Dockerfile to update npm thought you might be interested in integrating it in to this container

npm install fs-extra \
    && cp -r node_modules/* /usr/lib/node_modules/npm/node_modules \
    && sed -i s/graceful-fs/fs-extra/g /usr/lib/node_modules/npm/lib/utils/rename.js \
    && sed -i s/fs.rename/fs.move/g /usr/lib/node_modules/npm/lib/utils/rename.js \
    && rm -rf node_modules \
    && npm install -g npm@latest

Add Git

npm packages pointing to Github repos are not installed because it can't find the git binary.

Alpine 3.4

Just a quick question.
Why is the alpine 3.4 base image only used for the node 6.2.1 build, and not for the 5.x, 4.x, 0.12, and 0.10 versions?
I can see it is deliberately moved back to 3.3 for those versions, so I'm guessing there is a good reason.

How do you build this project?

I get the following error when running Docker on Ubuntu 15.04:

OK: 177 MiB in 52 packages

Executing busybox-1.23.2-r0.trigger
Executing ca-certificates-20141019-r2.trigger
tar: invalid magic
tar: short read
INFO[0028] The command [/bin/sh -c apk add --update curl make gcc g++ python linux-headers paxctl libgcc libstdc++ && curl -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz | tar -xz && cd /node-${VERSION} && ./configure --prefix=/usr ${CONFIG_FLAGS} &amp;&amp; make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && make install && paxctl -cm /usr/bin/node && cd / && if [ -x /usr/bin/npm ]; then npm install -g npm@2 && find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; fi && apk del curl make gcc g++ python linux-headers paxctl ${DEL_PKGS} && rm -rf /etc/ssl /node-${VERSION} ${RM_DIRS} /usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html] returned a non-zero code: 1

LTS tag?

Now that Node.js has an LTS version, might it be a good idea to also have an lts tag here?

Cannot connect to external MongoDB host

Node is unable to connect to a MongoDB instance hosted outside the image.

NPM package mongoose is being used to connect to the database. Given the IP address and port (unchanged) of the MongoDB, the code works just fine without making a change if we use node:latest image from Dockerhub.

Could this be because outbound communication is blocked?

Why is there no 0.12.7 Tag?

Could be the case that I missed something but the Readme says that alpine-node-base has a 0.12.7 tag but it has not.
What I noticed tho is that latest seems to give you 0.12.7. Did the missing tag happen by mistake or by intend?

Building v0.10.46 fails with "configure: error: no such option: --fully-static"

when uncommenting this line:
ENV VERSION=v0.10.46 CFLAGS="-D__USE_MISC" NPM_VERSION=2
running docker build results with this error:

node-v0.10.46.tar.gz: OK
Usage: configure [options]

configure: error: no such option: --fully-static
The command '/bin/sh -c apk add --no-cache curl make gcc g++ python linux-headers paxctl libgcc libstdc++ gnupg && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 FD3A5288F042B6850C66B31F09FE44734EB7990E 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 DD8F2338BAE7501E3DD5AC78C273792F7D83545D C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 B9AE9905FFD7803F25714661B63B535A4C206CA9 && curl -o node-${VERSION}.tar.gz -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz && curl -o SHASUMS256.txt.asc -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc && gpg --verify SHASUMS256.txt.asc && grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - && tar -zxf node-${VERSION}.tar.gz && cd node-${VERSION} && export GYP_DEFINES="linux_use_gold_flags=0" && ./configure --prefix=/usr ${CONFIG_FLAGS} &amp;&amp; NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) && make -j${NPROC} -C out mksnapshot BUILDTYPE=Release && paxctl -cm out/Release/mksnapshot && make -j${NPROC} && make install && paxctl -cm /usr/bin/node && cd / && if [ -x /usr/bin/npm ]; then npm install -g npm@${NPM_VERSION} && find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; fi && apk del curl make gcc g++ python linux-headers paxctl gnupg ${DEL_PKGS} && rm -rf /etc/ssl /node-${VERSION}.tar.gz /SHASUMS256.txt.asc /node-${VERSION} ${RM_DIRS} /usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html' returned a non-zero code: 2

Image size nearing 400MB (.nyc_output)

Hello!

I have an issue with the container, when I try to build it myself (I want to test it against alpine:edge).

I'm taking the current Dockerfile provided on this repo and do a docker build -t mytag .. But then my image size is 398.6 MB. Do you have any clue about this? Anything special to do?

Thanks

Edit: after investigation, folder /usr/lib/node_modules/npm/.nyc_output takes up to 330 MB. I added it to the final rm command. If usefull, I'm building on OSX using latest Docker for mac beta

Add Python installation for node-gyp functionality

I was getting an issue where a module would fail to build causing dependency hell. All that needed to be done is adding this one line:

RUN apk add --update python

I'll create a PR for this. I think it would be nice to have it included with this image since node-gyp is something used often within node.

Automated build on quay.io

Hi

I started a repository on quay.io quay.io/loicmahieu/alpine-node for testing git tag to docker tag and it works pretty well so I thought that it can be useful to share the idea here.

So the idea behind image quay.io/loicmahieu/alpine-node is:

  • Automated build: I suppose @mhart currently builds all images in his own and push it to Docker Hub.
  • Git tag for each version: Better visibility in Github etc...
    Examples:
base-v3.3.0
v3.3.0
base-v4.0.0
v4.0.0

Tags without base- are full build.

  • One image regardless of iojs/node: iojs and node version names are not conflicting together so we can have only one image.
  • Git tag become Docker tag: Quay.io is the only repository hosting (that I know !?) that allows you to automatically make docker tag from git tag. You can filter it with a regex. Regex used here is: (heads/master)|(tags/(base-)?v([0-9]+)\.([0-9]+)\.([0-9]+))

At this time, the image quay.io/loicmahieu/alpine-node is build from my fork. The only difference between my fork and @mhart is the git tags. I written a small script for automatically create tags from commit message: https://gist.github.com/LoicMahieu/db7e5f4916714d97fb67

Caveat of Quay.io:

  • You can't push multiple tags are the same time... Really annoying but we can workaround in git push origin [tag] one tag at the time.

My idea behind this issue is only to open the discussion.
Thanks!

rebuild with updated base image

Current image has broken openssl. It would be nice to have it rebuilt with the updated/fixed alpine images ASAP.

(They should also have a significantly faster default mirror)

Question about nodejs compilation

Hi

I took inspiration from your work to make my own alpine-nodejs +stuff Dockerfile. I got a puzzling issue : everything is building fine on my centos's VM but pushing to the public registry I end up with

collect2: error: ld returned 1 exit status �[0mdeps/v8/tools/gyp/mksnapshot.target.mk:139: recipe for target '/node-v5.6.0/out/Release/mksnapshot' failed �[91mmake[1]: *** [/node-v5.6.0/out/Release/mksnapshot] Error 1 �[0mmake[1]: Leaving directory '/node-v5.6.0/out' Makefile:45: recipe for target 'node' failed

Does that ring a bell to you by any chance?

Best regards,

Add the image to quay.io

I would like to know if you could consider to push this image to quay.io.

The reason is because is very good in terms of size and it'd very helpful to use it as a dependency for abuild (App Standard Container tool).

acbuild can use dependencies hosted under a domain (e.g example.com/nick/image), however as far as I know isn't possible to se docker images hosted in hub.docker.io as a dependency, but quay.io offer that making an APC image usable with rkt.

An example of an quay.io image can be used in acbuild is https://github.com/appc/acbuild/blob/master/examples/nodejs/build-nodejs.sh#L19

I think that this is the best solution than others as forking this repo only for that purpose; there's actually a fork for that but is out of date and I think that for you only would be to setup a free account in quay.io and register the hook.

Thanks for considering.

Rebuild fails: collect2: error: ld returned 1 exit status

Hi, I was trying to rebuild the image, but getting the following error:

g++ -pthread -rdynamic -m64  -o /node-v5.10.1/out/Release/openssl-cli -Wl,--start-group /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/app_rand.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/apps.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/asn1pars.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ca.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ciphers.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/cms.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/crl2p7.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dgst.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dh.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dhparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/dsaparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ec.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ecparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/enc.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/engine.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/errstr.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendh.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/gendsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genpkey.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/genrsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/nseq.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ocsp.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/openssl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/passwd.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs12.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs7.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkcs8.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkey.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyparam.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/pkeyutl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/prime.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rand.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/req.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsa.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/rsautl.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_cb.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_client.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_server.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_socket.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/s_time.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/sess_id.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/smime.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/speed.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/spkac.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/srp.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/ts.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/verify.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/version.o /node-v5.10.1/out/Release/obj.target/openssl-cli/deps/openssl/openssl/apps/x509.o /node-v5.10.1/out/Release/obj.target/deps/openssl/libopenssl.a -Wl,--end-group -static -ldl
g++ -pthread -rdynamic -m64 -fuse-ld=gold -B/node-v5.10.1/third_party/binutils/Linux_x64/Release/bin -m64  -o /node-v5.10.1/out/Release/mksnapshot -Wl,--start-group /node-v5.10.1/out/Release/obj.target/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_base.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_nosnapshot.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_libplatform.a /node-v5.10.1/out/Release/obj.target/deps/v8/tools/gyp/libv8_libbase.a -Wl,--end-group -static -ldl -lrt

/usr/lib/gcc/x86_64-alpine-linux-musl/5.3.0/../../../../x86_64-alpine-linux-musl/bin/ld.gold: fatal error: /node-v5.10.1/out/Release/mksnapshot: Not supported
collect2: error: ld returned 1 exit status
make[1]: *** [/node-v5.10.1/out/Release/mksnapshot] Error 1
deps/v8/tools/gyp/mksnapshot.target.mk:140: recipe for target '/node-v5.10.1/out/Release/mksnapshot' failed
make[1]: Leaving directory '/node-v5.10.1/out'
make: *** [node] Error 2
Makefile:63: recipe for target 'node' failed

The command '/bin/sh -c apk add --no-cache curl make gcc g++ binutils-gold python linux-headers paxctl libgcc libstdc++ gnupg &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 9554F04D7259F04124DE6B476D5A82AC7E37093B &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E &&   gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D &&   gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 &&   gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 &&   curl -o node-${VERSION}.tar.gz -sSL https://nodejs.org/dist/${VERSION}/node-${VERSION}.tar.gz &&   curl -o SHASUMS256.txt.asc -sSL https://nodejs.org/dist/${VERSION}/SHASUMS256.txt.asc &&   gpg --verify SHASUMS256.txt.asc &&   grep node-${VERSION}.tar.gz SHASUMS256.txt.asc | sha256sum -c - &&   tar -zxf node-${VERSION}.tar.gz &&   cd /node-${VERSION} &&   ./configure --prefix=/usr ${CONFIG_FLAGS} &&   make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) &&   make install &&   paxctl -cm /usr/bin/node &&   cd / &&   if [ -x /usr/bin/npm ]; then     npm install -g npm@${NPM_VERSION} &&     find /usr/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf;   fi &&   apk del curl make gcc g++ binutils-gold python linux-headers paxctl gnupg ${DEL_PKGS} &&   rm -rf /etc/ssl /node-${VERSION}.tar.gz /SHASUMS256.txt.asc /node-${VERSION} ${RM_DIRS}     /usr/share/man /tmp/* /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg     /usr/lib/node_modules/npm/man /usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html' returned a non-zero code: 2`

Missing package 'debug' for Express Application

While trying to package a NodeJS application I get the following stack trace:

> node ./bin/www

module.js:440
    throw err;
    ^

Error: Cannot find module 'debug'
    at Function.Module._resolveFilename (module.js:438:15)
    at Function.Module._load (module.js:386:25)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/bin/www:2:13)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)

npm ERR! Linux 4.3.6-coreos
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the IoT-Playground package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs IoT-Playground
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls IoT-Playground
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /npm-debug.log

Not sure why this is happening. I even tried building my own node image by compiling everything from source (like you did), and the same thing happened.

Any idea what might be causing this?

Getting "exec format error"

When running image, I get error:

$ docker run -it mhart/alpine-node:4 sh
standard_init_linux.go:175: exec user process caused "exec format error"

This is on my Raspberry Pi.

$ docker info
Containers: 12
 Running: 0
 Paused: 0
 Stopped: 12
Images: 21
Server Version: 1.12.1
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options:
Kernel Version: 4.4.15-hypriotos-v7+
Operating System: Raspbian GNU/Linux 8 (jessie)
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 862 MiB
Name: black-pearl
ID: QLG7:HLFA:YNZ2:SNNF:5XC3:ORPG:WUM6:NC3K:JK45:RXPO:SGCL:NI6J
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No cpuset support
Insecure Registries:
 127.0.0.0/8

Move to alpine:latest

Latest alpine linux image is 3.3. They are pretty the same but in 3.3 new community repo was introduced. It is very helpful in custom builds.
It would be great to have latest base image for nodejs apps.

Issue when Alpine is updated

Hi!

I have just encountered this issue, since alpine linux was recently updated and you were so quick to update your image as well (great job, though! 👍 )

Some of the packages that I use in that image, are not present in alpine 3.4 so my build fails.
Is it possible to keep the "previous alpine" version up? So, in this case, it will be very useful to have a alpine-node:base with Alpine 3.3 and another with Alpine 3.4.

Thanks!

Wouldn't it better to use and maintain Alpine packages?

I've updated iojs package yesterday (pull-requested and it is already in testing repo) and nodejs package can be updated as well. However, I'm not in nodejs/iojs development, I just wanted to play with it, so I won't be able to maintain those packages.

Wouldn't you volunteer to maintain iojs and, possibly, nodejs packages?

Best Practices for Non-root User

First of all, thanks for creating and maintaining such a wonderful docker image! You're always so quick to update when a new version of node comes out 💯. And now for my question...

In the official docker-node repo, there is a Best Practices doc that explains you should create a user instead of running as root.

# Add our user and group first to make sure their IDs get assigned consistently
RUN groupadd -r app && useradd -r -g app app 

Does alpine-node have a similar best practice?
What is the equivalent groupadd and useradd in Alpine?

Add onbuild images?

Compare with official node images, I can't find any mhart/alpine-node with tag of onbuild, which is useful.

For example,

FROM mhart/alpine-node:4

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

ONBUILD COPY package.json /usr/src/app/
ONBUILD RUN npm install
ONBUILD COPY . /usr/src/app

CMD [ "npm", "start" ]

Could you plan the onbuild image as above for all version?

Add instructions to Dockerfile example to build native dependencies without significantly increasing image size.

Building node-gyp has come up a few times in the issues, and I understand that including the tools to build it adds significantly to the image size, making it larger than even the slim images from the official node builds.

However the current readme example installs the dev tools to an intermediate layer, which makes it impossible to clean up and keep the image size low without using an external squash program.

If you want to clean up the dev tools after npm install, you need to execute it all on a single RUN command to prevent docker from creating bloated intermediate layers. There are two options, a one line script chained together with && or including a ash build script in your repo then calling that with RUN.

The first option is likely sufficient. For example:

RUN apk add --no-cache make gcc g++ python && \
    npm install && \
    npm cache clean && \
    apk del make gcc g++ python

Including this in the readme might help some of those looking to use this image (thanks btw, love it!) but still need to build node-gyp.

node-serialport installs but is not usable

I use FROM mhart/alpine-node in my dockerfile and I added build-base make gcc g++ python with apk add because I need the node-serialport npm package https://github.com/voodootikigod/node-serialport which has to compile some binaries.

> [email protected] install /app/node_modules/serialport
> node-pre-gyp install --fallback-to-build

[serialport] Success: "/app/node_modules/serialport/build/Release/node-v46-linux-x64/serialport.node" is installed via remote
[email protected] node_modules/serialport
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected])

However as soon as I try to user node-serialport it fails with:

npm ERR! Linux 3.19.0-30-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v4.3.0
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node ./bin/www'.
npm ERR! This is most likely a problem with the app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get their info via:
npm ERR!     npm owner ls app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /app/app/npm-debug.log
module.js:435
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Error relocating /app/app/node_modules/serialport/build/Release/node-v46-linux-x64/serialport.node: __strcpy_chk: symbol not found
    at Error (native)
    at Object.Module._extensions..node (module.js:435:18)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/app/app/node_modules/serialport/serialport.js:14:25)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)

I already opened an issue serialport/node-serialport#682 however it is not getting very much attention. I believe this is an issue with alpine because on ubuntu it used to work fine. Here is some installation information:

We are using node-pre-gyp to compile and post binaries of the library for most common use cases (linux, mac, windows on standard processor platforms). If you are on a special case, node-serialport will work, but it will compile the binary when you install.

This assumes you have everything on your system necessary to compile ANY native module for Node.js. This may not be the case, though, so please ensure the following are true for your system before filing an issue about "Does not install". For all operatings systems, please ensure you have Python 2.x installed AND not 3.0, node-gyp (what we use to compile) requires Python 2.x.

Do you have an idea how to solve this?

Can not install node module kerberos

Installing kerberos module and get below error, which can be solved by installing libkrb5-dev (Debian/Ubuntu) or krb5-devel (CentOS) , accrording https://github.com/christkv/kerberos/issues/21.

Is there a package available in alpine ?

> [email protected] install /home/src/reedsec-risk-gateway/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)

make: Entering directory '/home/src/reedsec-risk-gateway/node_modules/kerberos/build'
  CXX(target) Release/obj.target/kerberos/lib/kerberos.o
In file included from ../lib/kerberos.cc:1:0:
../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory
compilation terminated.
kerberos.target.mk:100: recipe for target 'Release/obj.target/kerberos/lib/kerberos.o' failed
make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
make: Leaving directory '/home/src/reedsec-risk-gateway/node_modules/kerberos/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.12-boot2docker
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/src/reedsec-risk-gateway/node_modules/kerberos
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 

npm install issue

Hi, when I run npm install -g gulp I get this, any clues?

 ---> Running in dea67c4677aa
npm ERR! Linux 4.1.18-boot2docker
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "gulp"
npm ERR! node v5.7.1
npm ERR! npm  v3.7.5
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! syscall getaddrinfo

npm ERR! getaddrinfo EAI_AGAIN registry.npmjs.org:80
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /root/app/npm-debug.log

I thought it was a SSL issue, so I tried running npm config set strict-ssl false && npm config set registry http://registry.npmjs.org, and I'm getting the same error.

System error: no such file or directory

Hi,

Running into this weird error on ubuntu 14.04 with docker installed properly via docker.io's method.

Any ideas?

$ sudo docker run -it mhart/alpine-node:latest /bin/sh
no such file or directory
Error response from daemon: Cannot start container 1644f323eeb4695d64919ec564ee14484ed58e1573ece583226de4dccfdebdc3: [8] System error: no such file or directory

FYI, this works fine on my local docker instance on OS X... so I am kind of confused here as of what is missing.

Thank you!

Can't resolve linked containers on Docker Cloud

Docker Cloud uses DNS rather than modifications to /etc/hosts to enable lookup between linked containers. Unfortunately, it triggers the same errors with musl that occur with Kubernetes (I think).

I realize this is an upstream problem; I figured I'd add an issue here so people would know where to find it. It might be worthwhile to mention in the README, like the Kubernetes issue.

Example file attached. Supposedly "alpine:edge" works correctly, so I'm going to see if I can build alpine-node with the edge tag instead of 3.3.

testalpine.yml.txt

Failing to build Dockerfile

Hi Michael, not sure if I'm missing something but when I try and build the image using your Dockerfile I get the following error:

/usr/lib/gcc/x86_64-alpine-linux-musl/4.9.2/../../../../x86_64-alpine-linux-musl/bin/ld.gold: fatal error: /node-v4.2.4/out/Release/mksnapshot: Not supported
collect2: error: ld returned 1 exit status
deps/v8/tools/gyp/mksnapshot.target.mk:139: recipe for target '/node-v4.2.4/out/Release/mksnapshot' failed
make[1]: Leaving directory '/node-v4.2.4/out'
make[1]: *** [/node-v4.2.4/out/Release/mksnapshot] Error 1
Makefile:45: recipe for target 'node' failed
make: *** [node] Error 2

Building on an Ubuntu 14.04 VM.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.