All Articles

The Debian Slim Docker Image

slim-girl-anime

Recently I occasionally learned there’s a group of docker images naming debian-slim. I’m curious about what’s the difference between the debian-slim and the debian. The first difference between the debian-slim and the debian is the size of the docker image. The debian-slim is much smaller than the debian.

Due to the answer to this stackoverflow question, the debian-slim is a lightweight alternative to the debian. The difference in the dockerfile shows that they rely on different versions of the rootfs.tar.xz. It indicates that the changes are managed by the debian team. The rules of how to build the debian-slim images are inside two files. By keeping the files listed in the includes and removing the files listed in the excludes, the debian-slim image is built.

On the other side, I tried to use the debian-slim images (acutally the debian:bookworm-slim) to build my docker image. It’s really easy to use and the size of my image has been cut off a lot, and debian-slim is finally comparable to the alpine.

Published Sep 9, 2024

Flying code monkey