Debian 与 Debian-Slim 有何不同?

Vac*_*ano 13 debian containers docker

我正在尝试为我公司的容器映像选择推荐的基本 Linux 发行版。

我已经将范围缩小到 Debian 和 Debian-Slim。

我读到的一切都说 Debian-Slim 只是一个配对的发行版。但我似乎无法找到有关它们有何不同的详细细节。

Debian 有哪些 Debian-Slim 没有的功能?

BMi*_*tch 14

您可以比较用于构建图像git repos(rootfs.manifest 很有用)。或者您可以运行每个图像并查看它们显示的内容不同:

$ docker run --rm debian:stable dpkg --get-selections >debian-stable-pkgs.txt

$ docker run --rm debian:stable-slim dpkg --get-selections >debian-stable-slim-pkgs.txt

$ diff debian-stable-pkgs.txt debian-stable-slim-pkgs.txt
23,24d22
< iproute2                                      install
< iputils-ping                                  install
35,36d32
< libcap2:amd64                                 install
< libcap2-bin                                   install
40d35
< libelf1:amd64                                 install
53d47
< libmnl0:amd64                                 install
77d70
< libxtables12:amd64                            install
Run Code Online (Sandbox Code Playgroud)

因此,通过排除少数软件包,他们能够从图像中删除 45MB,即大约 40%。

$ docker image ls debian
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
debian              stable-slim         eb8569e750e6        2 weeks ago         69.2MB
debian              stable              405289501bdf        2 weeks ago         114MB
Run Code Online (Sandbox Code Playgroud)

  • 在构建脚本 debuerreotype-slimify 期间将删除更多文件,删除的文件列表如下:https://github.com/debuerreotype/debuerreotype/blob/master/scripts/.slimify-excludes (5认同)