Hi everyone,
I need to have a cli tool that is not implemented in HA Core (in my case: ipmitools). My idea is to provide a addon (aka docker image) that uses just the base image and apt installing the cli tool.
So my dockerfile would look something like this:
ARG BUILD_FROM
FROM $BUILD_FROM
ENV LANG C.UTF-8
# Install requirements for add-on
RUN apk add --no-cache ipmitools
Now I have 2 questions left hoping you can point me in some right direction:
Is this even feasable?
How do I call/execute my addon from within HA just like a script?
As you can mabye see, I’m a HA development/docker-beginner. Any Help is appreciated.
If I am understanding your question correctly. I’m wondering if it would be a good idea to be spinning off processes with unknown ‘weight’ and effect within the HA sandbox? I think that is why the HA developers are pretty strict about what you can run. You can run scripts within HA sandbox, I have a couple light ones that query linux for cpu temp, fan speed and network specs. I run HA in a docker container on Ubuntu 20. However for heavy stuff like network bandwidth speed test I run in host space as cron job in this case, or run in parallel docker container. Most communicate back to HA via MQTT. You could use App Daemon, which again runs outside HA space, but has good direct interface to HA to create and query entities.
Can’t you put the executable somewhere within the Docker volume that gets mapped to HA? Or even add an additional volume that looks something like this:
'/usr/bin/ipmitool:/usr/local/bin/ipmitool:ro'
(which assumes you have installed ipmitools on the host)
Yes I believe you can. I just don’t know how heavy or what ipmtool needs access to. The whole user id thing within docker is a bit a pain at times, and the issues around having to sudo or equivalent for some things.
I can’t put the ipmitools on the host itself, since it is a standard installation on a Raspberry Pi 3. So I do not have a containerized installation.
The idea was also to provide an addon so others can use it as well.
And using a bash script isn’t possible if ipmitools is not present on the host (HA core).
I don’t think that ipmitools adds a lot of weight, since it is very similar to a ssh/wol command.
You just ipmitool -I lanplus -H 192.168.1.XX -U admin -P securepassword power on once and that’s all the magic.