homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.

Home Page:https://hub.docker.com/r/homebridge/homebridge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updating Homebridge UI and Node.js inside container does not persist container restarts

seanob86 opened this issue · comments

Describe The Bug

In the readme under Automated Updates, it states the following:

NOTE - The version of Homebridge IS NOT tied to the version of the container. You can update Homebridge, the Homebridge UI and the Node.js runtime from inside the container.

However tearing down the container and bringing the container back up reverts the updates back to image default. For example the Homebridge UI update to 4.50.5 will not persist after the following
docker compose down
docker compose up -d
or docker compose up -d —force-recreate

From my limited understanding, it seems both UI updates and Node.js updates inside the /opt/homebridge directory but only the /homebridge directory will persist data per the docker compose file.

Therefore it seems that yes you can update inside the container per the README, but with the caveat that data will not persist for Node.js and Homebridge UI updates.

Is this expected?

Docker Config

version: '2'
services:
  homebridge:
    image: homebridge/homebridge:latest
    container_name: homebridge
    restart: always
    network_mode: host
    volumes:
      - ./config:/homebridge
    logging:
      driver: json-file
      options:
        max-size: "10mb"
        max-file: "1"

Logs

No response

Host Operating System

Raspberry Pi OS - Latest

Host Architecture

aarch64 / arm64

@seanob86 Take a read of the documentation for docker compose down versus docker compose stop

Down stops containers and removes containers, networks, volumes, and images created by up

PS Tks for a great issue with detailed instructions to recreate the issue

Thanks! Yeah i know the difference between down and stop/restart. I just wanted to point out that updates are not persistent and if for example host system reboots/encounters power outage, those updates will need to be run again.

Hopefully there will be a solution for this in the future without relying on new updates to the image e.g. docker compose pull.

Just to ensure that my understanding was correct, I ran thru both reboot and power failure scenarios, and I did not lose the update to Homebridge-config-ui-x 4.50.5, but when using the down command I did lose the update.

Are you seeing something different

Latest docker, running on a RPI 3B, with the most recent docker-homebridge image.

You are right!! Reboot does not lose the updates. Thanks!
I forgot that I have a script for rebooting my host server which (prior to reboot), iterates through all my docker containers with docker compose down.

I suppose, as long as down is not used there should be no issues.
Another alternative which is working is to persist the /opt/homebridge directory and node and UI updates are persisting through docker compose down


    volumes:
      - ./config:/homebridge
      - ./homebridge:/opt/homebridge:rw

Are there any downsides to making this change ? Any impact when the container version is updated ?

I suppose the downside is any newer updates to node or the ui on an updated container, will most likely be overriden by what is on the host/volume mapping. So any versions in the volume mapping that is older will not get the benefits of the updates in the latest container. Therefore it's probably not recommended and best to update those components how it exists today, with the caveat that docker compose down will undo those updates.

I did further narrow down volume mappings for node and ui, so not all data in /opt persists. I'm going to leave these mapping on my configuration for now until I discover something that has broken (but for now everything is ok).

      - ./homebridge/bin/node:/opt/homebridge/bin/node:rw
      - ./homebridge/lib/node_modules/homebridge-config-ui-x:/opt/homebridge/lib/node_modules/homebridge-config-ui-x:rw

Prior to adding the above volume mappings, I copied /opt/homebridge/bin/node and /opt/homebridge/lib/node_modules/homebridge-config-ui-x/ out of the container to the host.

Thanks for this detail, am thinking we can close this ?