homebridge / docker-homebridge

Homebridge Docker. HomeKit support for the impatient using Docker on x86_64, Raspberry Pi (armhf) and ARM64. Includes ffmpeg + libfdk-aac.
https://hub.docker.com/r/homebridge/homebridge/
GNU General Public License v3.0
2.57k stars 240 forks source link

After updating homebridge in a container to latest version, a podman run will overwrite with a previous version #367

Closed mflannery closed 3 years ago

mflannery commented 3 years ago

Describe Your Problem: I am running Homebridge in podman containers. I assume docker containers would have the same issue. To create the container, I issue a podman run --name=homebridge ... docker.io/oznu/homebridge:latest. If the container is behind in version, I will see in the GUI that a new version of the software is available. If I upgrade via the GUI and then do a podman stop homebridge && podman rm homebridge and then do another podman run name=homebridge ... docker.io/oznu/homebridge:latest, the upgrade I did via the GUI is lost. I have found this also happens with the Hombridge UI plugin but not with any other plugins.
Logs:

There is nothing in the container because everything is working as designed.  Unfortunately its the design that is failing.

Show the Docker container logs here

There is nothing in the podman container logs because nothing is failing.

Docker Start Command:

podman run --name=homebridge --detach --network=host -e PUID=1000 -e PGID=1000 -e TZ=America/New_York -e HOMEBRIDGE_CONFIG_UI=1 -e HOMEBRIDGE_CONFIG_UI_PORT=8581 -v /mnt/homebridge:/homebridge --restart always docker.io/oznu/homebridge:latest

Homebridge Config:

There is nothing in the config that pertains to this.

Screenshots:

Before podman run

image

Now execute

podman stop homebridge
podman rm homebridge
podman run --name=homebridge --detach --network=host -e PUID=1000 -e PGID=1000 -e TZ=America/New_York -e HOMEBRIDGE_CONFIG_UI=1 -e HOMEBRIDGE_CONFIG_UI_PORT=8581 -v /mnt/homebridge:/homebridge --restart always docker.io/oznu/homebridge:latest

image and image

So part of the homebridge container is persisting and part is not. It seems that either the container needs to keep up with homebridge versions so that a podman run done after a GUI update does not down grade homebridge or the software and plugin need to persist.

This can end up being a bigger issue with podman where you set up podman with auto-update. Auto update works by stopping and then rerunning containers on a regular basis by executing the podman run command in systemd. If there is a new version of the container, this new version is pulled down and run with the podman run command. As you can see, if you update homebridge via the GUI and then the auto-update occurs, you could end up downgrading the main software and the homebridge-ui plugin. Also, since you use systemd to automatically start the container at boot time, any time you reboot or simply stop and then restart the container via systemd, the container is "run" and the latest container is pulled from the repository but this latest container might not be the actual latest version of the homebridge software or homebridge-ui plugin.

The best solution for users is to keep the docker container in sync with the latest versions of the Homebridge and the Homebrige-UI software. But that could be a lot of work depending on how many people maintain this docker container and how often the homebridge and homebridge-ui software is updated. An alternative would be to place the homebridge software in an area in the container that does not get updated with a new container pull. The plugin might be able to be done this way by putting it in the same area with the other plugins but I'm not so sure about the actual homebridge software. Other plugins persist just fine through subsequent podman run commands as does the config.json file. I'm sure there are others that persist as well.

Environment: Homebridge 1.3.4 npm 6.14.11 podman 3.0.1 fedora 33 docker.io/oznu/homebridge:latest

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.