Iâm not sure if there is a difference using docker-compose (I never use it) but when I want to update to the latest version I delete the existing container, do a pull then re-create the container using my docker run command.
Or more often I just use Portainer to do it. there is an option to pull the latest image when you tell Portainer to re-create the container.
I just tried that but it wonât start up because the containers already exist⌠is that because I didnât use docker compose to create them in the first place? should I delete my existing containers first?
Gotcha. I thought that might be it. So I just removed the containers and ran compose and everything came up. If I use watchtower to keep some containers up-to-date will that be a problem? Will I be able to use docker-compose as well say in a script? (Sometimes some containers go rogue and chew up memory so Iâm thinking of an automation to run a script with docker-compose)
Also I assume I can still update through portainer if I want to?
The watchtower docs seem to indicate that you can use docker-compose to start up containers so Iâm guessing that it will work. I only use watchtower for non-HA stuff anyway.
It was a pebkac error in the way I was refreshing the container.
I had not actually setup the docker-compose completely and still needed to run the command line docker command to delete the image and pull it back down again.
Thatâs why you keep persistent data out of the container and âbind-mountâ into the container at start-time. Containers are ephemeral and everything in them is gone, once they are deleted.
The docker-compose file from above is missing an important mount:
All make sense. Problem is that the official install docs donât seem to cover this, thus when you follow their updates steps you could lose data or at least not have your data loaded into the updated container.
For example this is the install doc command. docker run -d --name="home-assistant" -v /PATH_TO_YOUR_CONFIG:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant
source: https://www.home-assistant.io/docs/installation/docker/
This downloads an image with no tags (docker images shows TAG= <none> )
The update command listed is sudo docker pull homeassistant/home-assistant:latest which downloads an image with tag latest
⌠and thatâs it. No further instructions for update aside from ârestartâ which doesnât update the container. When I fire up another container using the original install command but specify the latest image it does not pull from my configs in /PATH_TO_YOUR_CONFIG (which of course I updated with my actual path). I also switch the image to homeassistant/raspberrypi2-homeassistant to match my pi. I need to go back to see if I made a mistake when updating the /PATH_TO_YOUR_CONFIG when running the latest image. Hoping thatâs all it is.
Installation with Docker is straightforward. Adjust the following command so that /PATH_TO_YOUR_CONFIG points at the folder where you want to store your configuration and run it:
This, from the documentation, as per above docker run -d --name="home-assistant" -v /PATH_TO_YOUR_CONFIG:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/raspberrypi3-homeassistant