Docker image size

Hi,

I was wondering about the size of the pihole docker image. It is around 150 MB packed and some 325 MB unpacked. Checking a native installation of pihole, the largest files are in /etc/pihole (notably pihole-FTS.db), but those are files created when the docker image/container first starts. Then how come, the image itself is so huge? Thanks!

Operating system & all downloaded and installed packages needed for Pi-hole?

the docker image is an entire operating system, not just /etc/pihole . A better comparison is a fresh debian/raspbian install + pihole install and seeing how big the disk is after using df -h /

Ok. That explains it. My understanding of a docker image is something that does explicitly NOT include the whole operating system. Providing the OS + App is a virtual machine image.

There are other people that provide Pi-hole as a docker container, and those container sizes vary between 30 MB and 70 MB. Which sounds more like what a docker image should take.

Update: You added a link to Stackoverflow. I am sorry to say, this does not help. Docker images do rely on the OS but do not include the OS. See docker.com

What about an added apt-get clean in the dockerfile?

Their size is related to using alpine instead of debian as the base OS. Alpine isn't an officially supported by Pi-hole's installer and they do a lot of hacks to get it to work. This requires more maintenance to keep it up to date as things change internally in pi-hole since they're basically re-implementing the installation - whereas we're just running the official installer to keep it simple. Yes it costs more space but is worth it for the maintenance/debug cost IMO.

Docker images do rely on the OS but do not include the OS.

Please read a bit more, the link was for educational purposes and includes some citations from official docker.com if you keep reading answers. Docker images start from an OS layer typically (not YOUR os per say) with code like FROM debian or FROM alpine.

Thats not something the "end user" of the docker image can do, is it?
That is something diginc would need to do in his Dockerfile or Docker compose file before uploading.

We do optimizations of the image to keep it's size small, feel free to review the Dockerfiles on

and review best practices

OK. I give up. I have read all that before, I am aware on how to build docker images and docker images I've done myself for lighttpd or vlmcsd or iperf3 (as examples) are nowhere 150 MB in size but something around 6 MB. I came here for some help in understanding and not being lectured. I am sorry I asked.

My tone wasn't meant to be demeaning or harsh, it is just my style to reference outside sources and try to help people understand the efforts put into the project and the history of things we've already tried. We did have an alpine version that was 70-90MB at one point but it was more buggy than the larger Debian version and maintaining two versions simultaneously (an official debian and unofficial alpine) was subtracting from the quality of the docker image overall so we went debian only.

I posted the links in earnest wanting anyone who can to help with the size if that's something they can help on. It is always possible we missed some small optimization that could save some size.

2 Likes

Does the size of the image cause any problems? Too slow to download, any limits on space on the host platform?

Lets keep it light please. You were provided with an explanation as to why we came to the decisions we did. There is no right or wrong here. As an open source project, anyone can make suggestions (preferably in the form of a pull request) if they feel that there is an area in which we could improve.

Having reviewed the posts in this thread, I can't see that anyone has been particularly condescending.

Friendly mod reminder to all

As included in the community guidlines

Be patient
Sometimes users, admins, and moderators alike will have difficulty in getting across a point they wish to make. This could be for a variety of reasons; Language barrier, technical knowhow, etc. Please be patient with everyone, and remember to respond to the content of a post, and not the tone.

ok. I see I was wrong. I am sorry if I caused any harm to anybody. That was not my intention. I was just exasperated as I wasn't able to formulate my question so that I got an answer that would help me. My problem. Again: I am sorry. I will do better. Promise.

That said: diginc mentioned that there were problems with the Alpine base image. Could you elaborate a little how those manifested themselves and what to lookout for? Thank you in advance.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.