Update docker?

Associate
Joined
24 Jul 2009
Posts
2,264
Location
-
I installed docker using the command sudo apt get install docker.io docker-compose -y at the start of the year on Debian (must have followed a YouTube guide) and have since learned that this is an old way of installing it as it's on version 20.10.24 of docker and 1.29.2 of docker compose.

I have many services running in docker now and I want to update docker. How can I do this without losing the services/containers I have running?
 
Last edited:
Updating docker should be as easy as sudo apt update and then sudo apt install docker. Are containers set to restart if stopped?

Updating the containers themselves depends again on how you set them up and what tags you’re using.

How are you updating other packages? apt upgrade?
 
Updates and upgrade for Debian are sudo apt update/upgrade. I have portainer installed to manually restart containers of needed.

Updating containers isn't a problem. It's just the docker version as it's 4 years old.

The newer way to install is 'sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin' but I don't want to run this if it'll mess up my current docker.
 
Last edited:
Fair enough. I’m not sure, there’s a risk upgrading from many versions can break things. You can make sure volumes/mounts with data are backed up and you have an image version and command/compose file for each container so if it is nuked you should be able to get back.
 
Thanks. I'll make backups and see where I get. According to the official install. I need to remove docker.io and docker-compose before installing the current way.
 
Back
Top Bottom