5 ms·
I use for nearly all my docker containers the distro Alpine Linux. It is much lighter. I commonly find that Alpine images use at least 300MB less disk than Deb
by juanmirocks 9y ago
I use for nearly all my docker containers the distro Alpine Linux.
It is much lighter. I commonly find that Alpine images use at least 300MB less disk than Debian ones.
- muxator 9y agoI think he was asking about debian as a host
- oweiler 9y agoFor containers I'd suggest using Debian slim.
- juanmirocks 9y agoInteresting, I didn't know about Debian slim. For comparison, I just found this blog post [1], claiming the following: > According to the docker images command, the debian:jessie-slim container clocks in at 88MB, compared to the full-fat debian:jessie container at 123MB. For reference, the ubuntu:xenial and centos:7 base containers are 130MB and 193MB respectively, where as the alpine base container is only 4MB, as mentioned in my post about the alpine base container. [1] https://elegantinfrastructure.com/containers/cotw-debian-jessie-slim/ https://elegantinfrastructure.com/containers/cotw-debian-jes...
- amenod 9y agoThis is always a dilemma for me... Alpine allows for really small packages, but I never got used to its packaging tools (and I don't feel confident writing Dockerfiles with it). A matter of practice I guess. Besides, Docker caches layers so if you're using some common base layer (like Ubuntu or Debian) it's probably already on the machine. So I usually write Dockerfiles as `FROM debian` and then later adapt them to Alpine if they're meant to be distributed.
- juanmirocks 9y agoYes, I did like you before. But once I got used to Alpine, apk (its package manager), and ash (its shell), I feel myself at home. Furthermore, in most occasions I find newer updated software on Alpine vs. Debian. Also besides disk space, I really have no idea how docker manages memory, but my assumption (naive?) is that smaller images will consume less RAM memory. I didn’t benchmark this though.
- amenod 9y agoSorry for late reply. Depends on what is in the package. Docker is just a thin separation of processes, so the situation is very similar to size of packages on host Linux OS. What matters is the size of binaries and loaded data, which I guess is not that different between distributions.