Run extra Docker container?

Hi,

Do I understand it right that Home Assistant OS is based on Docker? Does that mean that I can run arbitrary Docker containers alongside HA on the same Raspberry Pi?

My use case is this: I have a couple of TP-link EAP access points and they need some management software running in the network. There’s a community edition of that software and someone has already made a Docker image out of that. So, I’d like to run that image on the same hardware where HA is already running. Is that possible? If yes, how can I achieve that?

Best regards,
Bart

1 Like

You can install the Portainer addon and/or the SSH & Web Terminal addon and disable protected mode. But you’re mostly on your own running additional containers in HA OS.

If you are going to be running additional docker containers you should probably be running HA Supervised instead of OS.

you get add-ons if you want them and you have more control over the base OS/Docker.

Where abs how do I disable protected mode? A quick Google doesn’t give relevant results…

In what sense am I more “on my own” compared to running without extra containers? I don’t have any commercial support anyway…

In the addon’s dashboard page.

Right, on the first page of each of those addons, and prominently featured in the docs for Portainer, at least.

The HA team discourages creating additional containers with HA OS because you’re still limited by the underlying HA OS in terms of what those containers can do, and there are non-obvious quirks such as that the paths from the perspective of the containers all start with /mnt/data/… The need to add non-addon containers points to HA OS perhaps not being the right install method for your use case, and a container-based HA install would give you more flexibility in running your own stuff. That’s probably why the only mention of Docker in the SSH & Web Terminal addon is this:

Has the option to access the Docker instance running on the host system.

I can vouch for the fact that it works, and I do run my own containers, but the HA team isn’t going to provide step-by-step instructions for doing it.

True, it is supported if you run Debian with no other software. Addind other Docker containers should not be an issue if your system has the resources. HaOS was just designed as a minimal hypervisor for HA.

If you want to run an additional container on the OS, why not develop it as an addon? That’s what I did to run a small SMTP relay on my network (so I can point everything to homeassistant.local:25 with no auth and it goes out via the gmail account I configured). Addons are basically docker containers with some JSON to define metadata.

3 Likes

If you want to control most of your docker container then just like @finity said you can always try supervised installation. I used this method because it’s simply better than the regular install. Furthermore, it will run Debian 10 with a 64bit version which makes it even better.

I wrote a guide if you need more information/help KRDesigns.com

Basically for all my add-ons can be run inside HA and the rest like MySQL, influxdb, and the rest of docker will run in parallel and control via portainer (not an addon)

1 Like

I’d actually be interested in this add on… if you willing t share.
how did you handle the recent lock down by google. did you configure your forwarded to use googles new app password ?

G

I actually have a speedtest app, by robinmanuelthiel/speedtest:latest that does a upload and download speed test and insert the results into a influxdb. it’s run as a docker-compose file atm on a RPi zero W atm, but that maxis out at 100Mbps and well, my internet is faster now… so need to move it.

my HA runs on a RPi4b… which is 1Gb capable so would like to repackage/move this little util onto that.
would love/appreciate some assistance.
G

I also tried to run additional docker containers. So I installed the add-on SSH & Web Terminal and configured

packages:
  docker-compose

In /share/docker/my-container I added a docker-compose.yaml:

services:
  myservice:
    image …
    privileged: true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./db:…

db is a local directory in the /share/docker/my-container directory. When I start the service without the db volune, the container starts fine. But when I start the service as is, docker refuses to start the service:

ERROR: for myservice: Cannot start service myservice: error while creating mount source path '/share/docker/my-container/db': mkdir /share: read-only file system

Any ideas how to solve this?

./db has to be on a writeable filesystem. Maybe somewhere in /config.