Local add-on: backup size, installing pre-built image without a container registry

I am new to Home Assistant add-on dev and Docker. I have successfully created a local add-on using this tutorial and creating files under /addons/. It works perfectly, but I have two questions:

  1. When I create a backup of the installed add-on, the backup size is 60 MB — compared to < 1 MB for the other official add-ons I have installed. The difference seems to be that my backup includes the Docker image that was locally built when I installed it, whereas backups of other add-ons do not. Why is that? Is it because my add-on is not using a pre-built image?

  2. Using these instructions, I managed to pre-build my add-on image. Is there any way to install this image locally without needing to host it in a remote container registry? i.e. Just like we can create a local add-on by adding a Dockerfile, config.yaml, etc. to /addons/, can we also simply copy a pre-built image to /addons/?

Thanks!

Did you ever find an answer to this? I just started to play around with add-ons, and mine are huge. That was not the intention.

Same here unfortunately. Did you find out how to solve this?

I think I solved the issue!
Reporting here so that other people can possibly benefit from it going forward.
As I had built the component from scratch myself on my system, I got the doubt that perhaps the docker images I built where hanging somewhere and linked to my addons.
So, here’s what I have done:

  • Stop the add-on
  • Remove my own repository where the add-on was pushed
  • SSH into HAOS and run the following docker command to purge any docker image not linked to any existing container on my system:
# docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
  • Reboot the entire system (not just HA container)
  • Add back my repository
  • Install the container again

Then I confirmed that new Full Backups did not contain huge files due to my container. I also created a Partial Backup of just my add-on which now takes only 0.1 MB instead of 282.5MB!!

Hope this helps anyone else hitting the same issue going forward.