Install HA supervised in Docker Container

Hi

I would like to run Home Assistant Supervised in a docker container ( please, no discussion why ! ) :slight_smile:

Home Assistant Supervised requires Debian. Based on that requirement my steps are as follow.

  1. Installed a headless Debian Bullseye on a PC. Installed necessary software including Docker and Docker-Compose.

  2. Following instructions how to install Home Assistant Supervised I created the following

dockerfile.FROM debian:latest

WORKDIR /HA

RUN apt-get update && apt-get upgrade -y RUN apt-get install jq wget curl avahi-daemon udisks2 libglib2.0-bin network-manager dbus apparmor apt-utils -y RUN curl -fsSL get.docker.com | sh

 
#works to this point
 

RUN wget https://github.com/home-assistant/os-agent/releases/download/1.2.2/os-agent_1.2.2_linux_x86_64.deb RUN dpkg -i os-agent_1.2.2_linux_x86_64.deb

ENTRYPOINT ["tail", "-f", "/dev/null"]
  1. I have verified that docker runs in the docker image.

  2. Unfortunately I have a error when building the image which I don’t understand and I would like to have some input to. Anyone that can help me ???

Preparing to unpack os-agent_1.2.2_linux_x86_64.deb ...
Unpacking os-agent (1.2.2) ...
Setting up os-agent (1.2.2) ...
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Created symlink /etc/systemd/system/multi-user.target.wants/haos-agent.service → /usr/lib/systemd/system/haos-agent.service.
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package os-agent (--install):
 installed os-agent package post-installation script subprocess returned error exit status 1
Processing triggers for dbus (1.12.20-2) ...
Errors were encountered while processing:
 os-agent
The command '/bin/sh -c dpkg -i os-agent_1.2.2_linux_x86_64.deb' returned a non-zero code: 1
The terminal process "bash '-c', 'docker build --pull --rm -f "dockerfile" -t ha:latest

These instructions may help

1 Like

Quite obvious, isn’t it?
You didn’t enable systemd in your container and the os agent requires it.

Heh, fine, but this is bound to fail in a bazillion ways, and is quite hopeless if you already stumble on that error, tbh :wink:

https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/

Thanks for the support :slight_smile:

systemd is the enabled default on Debian. Do you a way to initiate it manually-

Not on the debian docker image you’re trying to build your image from.

https://www.google.com/search?q=systemd+inside+docker

It’s not designed to be installed like this.

well, technically it is because the supervisor already IS running inside its own container by default but it’s not designed for you to install your own supervisor container outside the install script.

just run a HA Supervised install instead of trying to re-invent the wheel.

1 Like