4 ms·
I use it for Node all the time. There are published docker images with Alpine as the base and just Node and any required packages installed. I've had to manuall
by FinalBriefing 4y ago
I use it for Node all the time. There are published docker images with Alpine as the base and just Node and any required packages installed. I've had to manually install a handful of libraries to support image processing, or anything else that NPM might not install itself.
- horsawlarway 4y agoSame here. It's a great base image for node projects. the Node 19 release alpine image is ~175mb, the same release on debian (bullseye) is roughly 1gb (998mb). Still ~80MB smaller than the bullseye-slim release (247mb). --- That said - if the ask was for using it as a daily driver on a machine (primary OS), I'd probably still pick a more fully featured distro (ex: my daily driver is Arch, not Alpine). The available packages and tooling in Alpine aren't really geared towards daily use as an OS, although some folks definitely do it.
- lxgr 4y agoIs it just me, or does this still seem about an order of magnitude larger than it reasonably needs to be? Given the size of Alpine itself (less than 10 MB, last time I checked), is it node that pulls in so much extra stuff, or something else?
- horsawlarway 4y agoNode is about 60mb on it's own. Taking a peak at the official dockerfile for alpine node (https://github.com/nodejs/docker-node/blob/28ad5e0e5d0e80df44d897c9057ffd6419a3c7a5/19/alpine3.16/Dockerfile https://github.com/nodejs/docker-node/blob/28ad5e0e5d0e80df4...), they're also pulling in the following packages && apk add --no-cache --virtual .build-deps-full \ binutils-gold \ g++ \ gcc \ gnupg \ libgcc \ linux-headers \ make \ python3 My guess is the most weight is probably coming from linux-headers (~10mb), python3 (~50mb), and nodejs (~60mb). Plus 1 to 10 mb for each of the other pacakges, and you end up right there around 175mb.
- makapuf 4y agoWhy does a minimal nodejs 19 distro need python3 ?
- arkx 4y agoMy understanding is that it’s because of node-gyp, used to build native addon modules for Node.js.
- horsawlarway 4y agoYeah, I looked again and it looks like they're actually only pulling those packages in when they need to build node for the current ARCH. (that's what I get for just scanning to the first call to apk add) They also appear to be cleaning them up, so I'm not actually sure where all that extra weight is coming from. Node itself is fairly trimmed down in the packages for alpine (40MB installed), but they're not using that package, they're pulling in their own version from their download sources - so it's possible they're including a lot of extra junk there. They also add yarn which is another 10mb. But in general - I agree, there's about 100mb of weight I can't actually explain in that image from a very quick look.