Alpine Linux Containers
What is Alpine Linux?
Many official Docker container images come in an alpine
variant.
They are based on [Alpine Linux][alpine], an incredibly lightweight distribution
that results in smaller image sizes. For example, the official Alpine-based
Golang image is almost 3x smaller than its Debian-based counterpart:
docker pull golang:1.19-bullseye
docker pull golang:1.19-alpine
docker images --filter 'reference=golang' \
--format '{{ .Repository }}:{{ .Tag }}\t{{ .Size }}'
golang:1.19-bullseye 993MB
golang:1.19-alpine 354MB
Alpine Linux achieves these gains by omitting many packages that are useful for a desktop OS, but are less important for a container image. The distribution uses musl libc instead of glibc, and busybox instead of dash or bash. Unfortunately, the barebones environment does result in a steeper learning curve and may cause incompatibilities with some projects.