How to make custom docker settings permanent?

Every time I upgrade HA, my docker settings get deleted, and I have to manually reconfig & restart the homeassistant container with Portainer.
How do I tell Supervisor I have custom docker settings, please?

Specifically, I need to configure:
Devices: /dev/ttyACM0 & /dev/hidraw0 (for Conbee II & WyzeSense bridge)
max-file & max-size (for limiting docker log size)
Container memory limit 2GB

I’m running supervised/supervisor on ubuntu 18.04.

Thank you

Did you figure this out, because I cannot. I need to add the same devices to my container, but have no idea how. :man_shrugging:

1 Like

You should mount a persistent volume on /config when you launch the docker container. You can do this with the -v option on the docker run command. Devices are passed into the container in a similar way using the --device option.

Alternatively, if you use docker-compose, then in your docker-compose.yaml (or whatever) file, you could have something like this (from mine)

  hass:
    container_name: hass
    image: "homeassistant/home-assistant:0.116.2"
    restart: "always"
    network_mode: "host"
    environment:
      - "TZ=America/New_York"
    volumes:
      - "/fast/hass/home-assistant/media:/media"
      - "/home/hass/home-assistant/config:/config"
      - "/home/hass/home-assistant/db:/config/db"
      - "/home/hass/home-assistant/logs:/config/logs"
      - "/mnt/music:/mnt/music:ro"
      - "/mnt/movies:/mnt/movies:ro"
    devices:
       - "/dev/ttyACM0:/dev/zwavestick"
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "2"

All the stuff specified in the docker-compose file can also be passed as options to docker run when you invoke it; do docker run --help to see what the specific options might be.

He can’t do this because running SUPERVISED.

1 Like

What David said.
I gotta believe there are many people running HA with Supervisor. And a good number of those folks have a Conbee II (or other zigbee coordinator) and/or Wyzesense bridge that need the linux device to appear inside the HA container for ZHA and addons to work.

I found in the source code where the HA container is started, and I think this is the moment when the host devices can be passed to the container:

I also found in the code that passing host devices into HA Addons is totally supported today, and I asked for help in the Development section of this forum:

My next step was to open a github issue for Supervisor, but I’ve been too busy to write this all up. I’m willing to write code to make this happen, but I could not figure out how a user’s config can be passed to this part of the Supervisor code.

How’d you go with this? Any luck?

This works without needing to change any config. The sticks will be mounted automatically.

Mmm, confused. Mine gets mounted fine at Hidraw0, but the Wyzesense bridge and HA always fails to pick it up and cannot pair. What to do?