Create add-on from existing docker image

Hi,

I’ve run Home Assistant Core using Docker for a number of years on my server and recently I installed Home Assistant OS for my mother on a Raspberry Pi. From what I’ve read I can see that HAOS is using Docker for all the add-ons which is great.

There is a image on Docker Hub that I can’t to make into an add-on so I can use it on this new installation. However I’m a bit confused as to how to proceed.

I’ve read the docs on Tutorial: Making your first add-on | Home Assistant Developer Docs and it says that I need to make a Dockerfile, config.yaml and run.sh to make it work.

However, if I want to use an existing image, that I am not the maintainer of, for my add-on. What do I do then?

I think the answer is put the base image you want to use in a build.yaml

What addon is it? It may already exist.

I wish this was easier. It would be awesome to be able to spin up an add-on like I can spin up a container with docker-compose. My recommendation: reach out to one of the few large community repos, send them a few bucks, and put in a request. Alex at GitHub - alexbelgium/hassio-addons: My homeassistant addons seems like a great guy and is super responsive to new add-on requests.

It’s this container: neilpang/acme.sh

It’s basically just a bash script but the Let’s Encrypt add-on that is available doesn’t seem to support domain alias for DNS-challenge which acme.sh does.

With domain alias I can have a subdomain which supports dynamic dns updates that I can point all my real domains to so I won’t have to add a TXT record for my domains.

Like this.

I have a subdomain acme.example.com which supports dynamic dns updates.
If I want a certificate for production.com I can just point _acme-challenge.production.com to _acme-challenge.acme.example.com etc.
By doing this I won’t have to enable dynamic dns updates for production.com.

acme.sh does share the Dockerfile on their git repo so I could theoretically make a HA add-on with this but I would rather use the main images so I could rely on the updates from Docker Hub rather than updating it myself.

Hi @PatricF

Did you slove this?

Running custom docker image inside Home Assistant OS is not recommended and will probably disable updates (see quote below). Nevertheless, if you really want to do it, here are two ways:

However, the Portainer docs state:

Installing manually a custom container will modify your HA status to an unsupported/unhealthy state. You will be blocked from upgrading Home Assistant and upgrading any Add-ons you may have. Stopping this custom container will reset the normal status

So the better solutions is to try to find a premade HA addon for the docker image, create your own addon, or don’t use Home Assistant as you base OS and run it inside a VM or container instead on top of another system.

Links for creating you own addon:

Existing addons can be found at https://addons.community or at this github repo with a lot of inofficial ones. Further repositories can be found here. For other addons search github.com and community.home-assistant.io.