-
Notifications
You must be signed in to change notification settings - Fork 36
Consider alpine/busybox base image #44
Comments
👍 |
Perhaps run this binary against the test suite to make sure it passes? |
@jbergstroem automated tests of our docker images is def on my roadmap. Just haven't had time. I'll open an issue for it though. |
Just saying that the alpine stuff is pretty much bleeding edge (that alpine-node seems to pull the latest available from alpine). If this ends up being our recommended solution, it'd be great to back that statement up. Btw, I'm also really like the suggested approach of minimising the container size as long as we're very comfortable with the toolchain that leads us there. |
@oren thanks, had considered doing the same... added issue suggesting the addition of pre-requisites for gyp... @jbergstroem cool, I'd thought about just seeing which version was in |
yup. tiny images are nice. Here is nginx in 6 MB - https://github.com/oren/alpine-nginx |
100% agree with the direction this is going. I'll be glad to tackle this, but it might be a few weeks before I'm at a point where I can explore this area (my backlog is pretty long right now). If @oren or @tracker1 (or others?) wants to kick off exploring this in the form of a PR to a new branch (maybe |
( //CC: @pesho @Starefossen @hmalphettes @jlmitch5) |
I also like this, and would welcome a PR adding it as a tag in this repo (possible tags: alpine, micro, busybox, or something else?) |
IMO "alpine" would be the most self-descriptive tag 😄
|
A few points, before anyone starts working on such a PR:
If it's not possible to satisfy the above, I think the Alpine image should remain separate. |
The source of the iojs package build is here: https://github.com/alpinelinux/aports/blob/master/testing/iojs/APKBUILD The image 'alpine:edge' does not contain gnupg indeed; Note that gnupg is available as a supported package. |
If we go down this route dont we need to provide the rest of the images: "iojs:alpine-slim", "iojs:alpine", "iojs:alpine-onbuild" ? Starting from @oren's Dockerfile I have been testing Alpine to run some modules with native dependencies. @oren's image is a fine alternative to iojs:slim. We would need a second fatter alpine image with the build tools to support this situation:
That image weighs 203 MB to be compared with the 700 MB of the debian based iojs image. |
What about having 2 images: 22 MB image for situations where native modules are not needed, and 700 MB for the other case. |
@oren at the moment there are 3 images based off debian jessie
@oren could you specify the content of the 2 images you have in mind? |
Good thing to have in mind: alpine runs on musl (at least when I last checked). Has anyone run the iojs test suite on such a docker image yet? |
Both _mjones from #alpine-linux and myself run the test suite. _mjonesenvironment Mineenvironment @hmalphettes you are correct about the number of images needed. It should match whatever we currently have. |
@hmalphettes given the binary capable version is about the same size as the current slim, I'd say that's pretty nice. |
@tracker1 agreed: it is very nice. |
I second @pesho's comment on verifying binaries in order for this to become an official io.js image under the |
👍 on verification, and I would still like to see #46 be a prerequisite to shipping this if it gets that far. |
Update: I am able to run the tests and get 4 errors. To reproduce it follow https://github.com/oren/test-iojs-docker-alpine
|
Looks like the first 3 are permission errrors (maybe)? The last one is a bit strange. I'm not used to running the iojs-test suite though. |
Unfortunately there are some challenges with running the io.js test suite 😕 Maybe someone at iojs/build may be able to help? |
FWIW, I've been using io.js on my Alpine Docker image for a while now (only 24.6 MB!) – there are only two failing tests on my stack, due to assumptions in the tests themselves. One test (test-module-loading-error.js) is loading an already-built native linux module, which I assume is built with glibc because it fails with "Exec format error" – native modules work fine on Alpine if they're compiled using musl (which npm/node-gyp will do during an npm install) – so I think the test scope here is too narrow. The test shouldn't just check for linux, but also for glibc – and perhaps have another option for musl-based linux distros. The other test (test-setproctitle.js) is failing because it's trying to run So apart from those minor test issues, it runs fine. You can check it out here: |
👍 |
Sorry for jumping in mid-stream here and not fully groking the entirety of this thread but I think @jbergstroem's point about testing needs to be expanded on: when @iojs/docker is considering releasing images based on specific platforms like this it would be great if we could take a more coordinated approach to the issue of platform support. If you go ahead and push an Alpine Linux based image while this distro is not part of our CI suite for io.js you're creating a gap in our understanding of what it means for it to be supported. I'd suggest that if you're set on doing this then @iojs/docker and @iojs/build find some way to integrate testing into regular CI such that we can be clearer about it being a supported platform, both in the current state of io.js and as it evolves over time. I don't know enough (anything?) about this distro so can't suggest a way forward but would love to help explore this. Perhaps something like build-containers for this if it's a container-focused distro? |
@rvagg I can commit to having a CI figured out for the iojs docker images by end of June. |
In this presentation redbeard makes the case that we should build our iojs/nodejs containers from scratch instead of relying on a general purpose distro: https://www.youtube.com/watch?v=gMpldbcMHuI |
Yes, or we can take this approach by @rmg. |
@hmalphettes Highly interesting talk, thanks for the link :-)! Basically, I agree with you, but… I think the solution can not be that every developer who wants to run Node.js using Docker has to build her or his own container. We need a really small and reliable official base image. Of course, this can be built using the techniques shown in the video, but it should be done once, not over and over again, shouldn't it? |
@Starefossen good point: build-container and runtime-container. @goloroden yes agreed. What I understood from the talk is that nodejs/iojs team here provides a "built from scratch" set of images. Downstream users of those images add their application: just like what we do today. I thought it was interesting to bring in the fact that we can choose buildroot or something else as an alternative to alpine linux if it helps. |
@Starefossen and friends: if we want to build iojs on the top of alpinelinux would this type of Dockerfile from @mhart be acceptable: https://github.com/mhart/alpine-node/blob/master/Dockerfile? Short of that we need to get involved with alpinelinux to maintain the iojs package. |
@hmalphettes @mhart is actually involved in this thread ;-) The blocker is testing which is being talked about in these threads: Once we get testing figured out, we can take it to the @nodejs/build team to get signed off on it being a supported platform as rvagg said in: #44 (comment) |
Yeah, so FWIW we've been running the Uniqlo US Mobile site on alpine-iojs in production for at least 6 months now with no problems (on 2.5.0 atm, haven't moved to 3.0.0 yet) I'm more than happy for ppl to use the image and/or the Dockerfile for whatever they'd like (and the license in the project should cover that). I try to keep it up to date as soon as new node/io.js releases come out, but given its current lack of automated testing, etc, it's probably not a good candidate to be officially sanctioned in any way. At least, as it stands right now. |
@Starefossen thanks for the mention :-) writes a long comment, reads thread, deletes comment because everything had already been said 👍 |
Thanks for the image |
@mkrn did you mean to post that as a new issue? Or is it related to this discussion about using alpine linux as a base image? |
Nevermind please @rmg I think node_modules were copying from my machine until i've added them to .dockerignore Thanks for the image! |
@mhart installing There are 3 failing tests for v5.0.0:
|
@hmalphettes Were you able to solve |
@polarathene that probably means you're using a statically compiled node.js binary? Which Alpine container (and tag) are you using? |
@mhart I'm using You're correct about them using a static compiled node.js binary I think, here is the Dockerfile for the image I'm using. How would I go about fixing this, and is there any drawbacks involved? If it's just compile time perhaps I could send a PR for a variant or replacement of the current Dockerfile. |
Yep, they're definitely statically compiling: https://github.com/smebberson/docker-alpine/blob/master/alpine-nodejs/Dockerfile#L9 You could use another image that doesn't statically compile. I have a bunch of them over here: https://github.com/mhart/alpine-node So you could use Or if you want to continue using the image you're currently using, you could just remove the |
I've created an issue on their repo letting them know about it, until then I'll give your images a go :) Thanks for the help, I looked into advantages/disadvantages of using dynamic linking instead of a static linking here, any idea if performance/memory is affected much with Node when built with dynamic linking? |
https://registry.hub.docker.com/_/alpine/
Though I'm not sure how much will actually be saved once Python2.7, build tools and libssl dependencies are installed, it might be worth considering.
The text was updated successfully, but these errors were encountered: