In order to safely update your docker container in a Synology NAS. I assume you manage your docker containers via docker-compose
- List the running containers
docker ps
- Go to the docker folder
cd /volume1/docker
- Copy the configuration (if needed)
cp -rp ha /volume2/backups/ha-bak.24.11
- Stop the container
docker stop homeassistant
- Make a backup
docker commit homeassistant homeassistant-backup:version-24.11
- Pull the latest image
docker pull ghcr.io/home-assistant/home-assistant:stable
or if you want a specific versiondocker pull ghcr.io/home-assistant/home-assistant:2024.11.3
- Remove the container
docker rm homeassistant
- If you have a specific version to use, edit the version of the image in the docker-compose file to the downloaded one (2024.11.3, default is stable)
vi docker-compose.yaml
- Start up the new container
docker-compose --verbose up -d homeassistant
Checklist afterwards:
- Check if configuration is loaded correctly:
docker exec homeassistant python -m homeassistant --script check_config --config /config
- Check for version: Settings > About
- Check for logs: Settings > System > Logs
- Update HACS plugins if needed
For a full recovery of a container:
- Stop and Remove the Current Container:
docker stop homeassistant
docker rm homeassistant
- Run a New Container from the Backup Image (or edit your docker-compose.yaml and start with docker-compose):
docker run -d --name homeassistant \ --restart=unless-stopped \ -v /volume1/docker/ha:/config \ -e TZ=Europe/Paris \ --net=host \ homeassistant-backup:version-24.11
No comments:
Post a Comment