-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Over 1.4 gigabytes of extra storage used for docker image #122
Comments
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid. |
The image size is not larger. The container layer is. Anyhow, installing quite a bit more than a thousand python packages on container start is not a better solution. I'm willing to review any PR that proposes a better solution to the problem at hand. |
It'd only be the first time the container started, and it's better than consuming 1.4 gigabytes of space needlessly. An alternate would be to chown only if the user/group was modified by the end user. What was the purpose of the hail mary change? Why did the original implementation of chown not work? |
Increased local storage space usage is a much lesser concern than increased bandwidth requirements, higher reliance on web connectivity (for thousands of dns queries and package downloads that significantly increase potential failure rate) and increased container start times (aka service downtime). You can get a very decent 1tb nvme for about $70. 1.4gb is nothing these days. Perms need to be fixed for HA to be able to install packages for HACS. Chown on start causes the overlayfs bug for many, which results in operations taking upwards of 20 minutes to complete. A move and chown operation prevents the bug, hence the current solution. |
Depends upon your environment. 1.4G is significant in my setup, and probably others as well. A slightly better approach combines the original implementation and the new one -- IFF the default group != docker group, copy and chown OTHERWISE create a link [hard or soft] from python.bak to python Another, even simpler solution, could be to disallow the setting of USER/GROUP in the docker container. |
Is there an existing issue for this?
Current Behavior
There is over 1.4 gigabytes in the writable layer of the home assistant docker image. This also means the total image size is over 1.4 gigabytes larger than it should be.
Either this change, aptly named "hail mary", or the original change, "chown system python packages" are the likely culprits.
Ideally, the python installation would not be modified at runtime. But, if there's no way around changing permissions at runtime, the docker image should not include python at all. Instead, install python during the first launch of the container. This would at least shrink the container by 1.4G and not cause /usr/local/lib/python to impact container size by double.
Expected Behavior
The image should not create a 1.5G writable layer.
Steps To Reproduce
Environment
CPU architecture
x86-64
Docker creation
Container logs
The text was updated successfully, but these errors were encountered: