Skip to content

Commit d35c0b5

Browse files
committed
docs: update Alpine size descriptions
1 parent f2e1347 commit d35c0b5

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,15 @@ need to install, thus reducing the overall size of all images on your system.
173173

174174
### `node:alpine`
175175

176-
This image is based on the popular
177-
[Alpine Linux project](https://alpinelinux.org), available in
178-
[the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is
179-
much smaller than most distribution base images (~5MB), and thus leads to much
180-
slimmer images in general.
181-
182-
This variant is highly recommended when final image size being as small as
183-
possible is desired. The main caveat to note is that it does use
176+
This image is based on
177+
[Alpine Linux](https://alpinelinux.org). Because base
178+
[alpine](https://hub.docker.com/_/alpine) images are smaller
179+
than corresponding base
180+
[debian](https://hub.docker.com/_/debian) images, the resulting
181+
`node:alpine` Docker images are around 25% smaller than the
182+
Debian-based `node:slim` images.
183+
184+
The main caveat to note is that it does use
184185
[musl libc](https://musl.libc.org/) instead of
185186
[glibc and friends](https://www.etalabs.net/compare_libcs.html), so certain
186187
software might run into issues depending on the depth of their libc
@@ -197,13 +198,14 @@ One common issue that may arise is a missing shared library required for use of
197198
[`gcompat`](https://pkgs.alpinelinux.org/package/v3.19/main/x86/gcompat) package
198199
to add the missing shared libraries: `apk add --no-cache gcompat`
199200

200-
To minimize image size, it's uncommon for additional related tools
201-
(such as `git` or `bash`) to be included in Alpine-based images. Using this
202-
image as a base, add the things you need in your own Dockerfile
203-
(see the [`alpine` image description](https://hub.docker.com/_/alpine/) for
204-
examples of how to install packages if you are unfamiliar).
201+
Tools such as `git` or `bash` are not included in `node:alpine*` based images. The
202+
[Alpine documentation](https://docs.alpinelinux.org/) describes how to find and
203+
install additional packages using `apk` (Alpine Package Keeper).
205204

206-
To make the image size even smaller, you can [bundle without npm/yarn](./docs/BestPractices.md#smaller-images-without-npmyarn).
205+
The
206+
[Best Practices document](./docs/BestPractices.md), in the section
207+
[Smaller images without npm/yarn](./docs/BestPractices.md#smaller-images-without-npmyarn),
208+
shows how to produce a custom image by removing package managers in a multi-stage build.
207209

208210
### `node:bullseye`
209211

0 commit comments

Comments
 (0)