Alpine is the base image which is based on Alpine Linux, a very compact Linux distribution. So, node:12.2.0-alpine is a Alpine Linux image with node 12.2.0 installed.
For the latest Alpine based image you can simply do node:alpine. If you want latest but not specifically Alpine you can do node:latest, that image will be based on stretch which is a Debian distribution.
You can find a full list of all supported tags here: https://hub.docker.com/_/node/
Answer from Ganhammar on Stack OverflowAlpine is the base image which is based on Alpine Linux, a very compact Linux distribution. So, node:12.2.0-alpine is a Alpine Linux image with node 12.2.0 installed.
For the latest Alpine based image you can simply do node:alpine. If you want latest but not specifically Alpine you can do node:latest, that image will be based on stretch which is a Debian distribution.
You can find a full list of all supported tags here: https://hub.docker.com/_/node/
I know that alpine means a smaller container size, but I'm mainly concerned about what you're missing out on if you switch to alpine.
From this 2022 blog post 'Choosing the best Node.js Docker image'...
Good:
This will yield a Docker image size of 196MB, which shaves off 64MB from the slim Node.js images, and in the Alpine image tag — as of the day I’m writing this — there are only 17 operating system dependencies and zero security vulnerabilities were detected.
Bad:
- However, it’s important to recognize that the Alpine project uses musl as the implementation for the C standard library, whereas Debian’s Node.js image tags such as
bullseyeorslimrely on theglibcimplementation.- Choosing a Node.js alpine image tag means you are effectively choosing an unofficial Node.js runtime.
- Unofficial-builds attempts to provide basic Node.js binaries for some platforms that are either not supported or only partially supported by Node.js. This project does not provide any guarantees and its results are not rigorously tested.
Some notable observations with Node.js
alpineimage tag compatibility are:
- Yarn being incompatible (issue #1716).
- If you require
node-gypfor cross-compilation of native C bindings, then Python, which is a dependency of that process, isn’t available in the Alpine image and you will have to sort it out yourself (issue #1706).