Homeassistant Docker with HACS and Build after pull

hi there, i am docker fanboy and maybe someone are looking for homeassistant with integrated hacs and custom modules, after pull / update

here is my config
docker-compose.yaml:

services:
  homeassistant:
    container_name: homeassistant
    image: homeassistant/raspberrypi3-homeassistant:latest
    build:
      context: .
      dockerfile: /root/config/homeassistant.Dockerfile
    command: >
      bash -c "wget -O hacs https://raw.githubusercontent.com/hacs/get/main/get
      && chmod +x hacs && ./hacs
      && python -m homeassistant --config /config"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /var/run/dbus:/var/run/dbus
      - /root/config/homeassistant:/config   
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host
    #ports:
    #  - 8123:8123

/root/config/homeassistant.Dockerfile:

FROM homeassistant/raspberrypi3-homeassistant:latest
RUN pip3 install --no-cache-dir recurring_ical_events
#ADD what you want
2 Likes

That is overkill, you only need to run HACS once and with every upgrade or new container, it is already in the persistent folder.

1 Like

Why do you assume that everybody has (or wants) a “persistant folder” while running Home Assistant?

I’m actually looking for a method to have an Home Assistant container with HACS already installed. Having no persistant storage allows me to run Home Assistant with multiple replica’s for example

Is it overkill for an avarage user? Probably :stuck_out_tongue: But some people are just looking for awesome configurations :slight_smile:

Loads of reasons… backup only the things you want (config, not the whole container), easier access to the config folder and underlying…etc. Unless you are tech-savvy this is not simple. Aside that, if you recreate the container…all your config is likely gone…so you need to copy that back
You can easily setup multiple persistant folders for multiple versions, I have 3 that run in parallel.
Anyhow…it is common practicce to use persistant folder

My Home Assistant is running on a seperate MySQL database. I have all my configs in git (except for my secrets ofcourse) and I build private docker containers to deploy on my kubernetes cluster. Aside from maybe custom_modules (if I’m going to use HACS) I really don’t see why I need persistant storage.

1 Like

OK…appreciate the update…but this is (repeating) only for the tech-savvy

I do not see how this would be a thing.
Unless you push more than you think to git.

You would need to go through onboarding and set up a new user account each time.
You would need to setup all (non-yaml) integrations each time
Also… the HACS “installation” would just be python files in your configuration directory, which is in git already?

This approach (if it’s really as described), does not make any sense to me as it can not really work.