How to upgrade/install docker and docker-compose properly?

Hello everybody,

Before continuing, I have a couple of question regarding updating docker;

  • Is there a way to upgrade docker without providing a shutdown. I guess no!
    But in this case how cloud providers are able to keep up with latest versions without causing a downtime?
  • Is it possible to update docker while conserving the containers. I guess that it's possible between the recent versions..

So I wanted to update the docker I'm using on a VPS (debian) so I tried to follow this guide

It suggests to uninstall altogether the current version and then to install it again using the latest version.

However when I want to uninstall docker using all the potential older names using sudo apt-get remove docker docker-engine containerd runc I got a message that none of these packages are installed.

I know mine is simply docker installed a couple of months ago (docker -v shows 18.09.0).

So I assume I probably didn't followed this guide at that moment.

Do you know how I can recover in my case?

Regarding docker-compose I guess that it's less critic since it seems to be only a binary
So I guess that I can remove the binary even if some containers are running and then simply download and set the new binary. Am I right?

And, now talking about binaries, I wonder if I didn't installed docker as binary too?
In this case can I delete the binary and then download it again the same way that docker-compose?

As a side note question, once I follow the 'package' installation method, will docker be updated automatically using the apt-get?

Sorry if some of these questions seem obvious or stupid..

And thank you very much…

submitted by /u/sanjibukai
[link] [comments]
Source: Reddit