Can I roll back to a previous version of Docker Desktop?
Asked Answered
P

6

58

On Mac, I'm running Lando inside Docker. I'm on Lando v3.0.1 and was running Docker Desktop v2.2.0.5 successfully.

Docker released stable an update v.2.3.0.3 and I installed it. After that I attempted to run Lando, but got a warning message stating the Docker Desktop version is not supported.

So, I'm wondering if it is possible to roll back to my previous Docker Desktop version without uninstalling Docker.

Prevot answered 5/6, 2020 at 14:28 Comment(11)
Do you still have the installer for the previous version of Docker Desktop?Torero
nope; it was an update from an update from an update, etc; so the version I have is pretty old about an year old.Prevot
Try the list of old installers here.Torero
Thanks; yes, I have downloaded the 2.2.0.5 version, but before I run it, I was wondering if there is a way to roll back to a previous version without having to replace the current installationPrevot
I don't know of one. However I would expect DD to keep its settings if you install the earlier version - it should detect that another version is installed, and will know how to overwrite it.Torero
so, I went ahead and and run the old install Docker v. 2.2.0.5 it replaced the previous version, and deleted all running containers (that was the scary part) After I recreated the container (Drupal 7 site), I got an error message when attempting to run to the site. I'm going to answer to my own question explaining what I did, so it might help another person looking for an answer on this.Prevot
Did it remove the stopped containers too (i.e. if you run docker ps --all)? I would be surprised if it does.Torero
yes; everything that was running before got destroyed.Prevot
Ah, sorry to hear that. Can it be recreated?Torero
Maybe there is an oddity on Windows that does that - it does not happen in Linux when one is up/downgrading.Torero
@Prevot Did you want to accept one of the answers? Othwerwise, the question pops back to the first page of questions every now and again.Piny
I
82
  1. Download your desired version from the Release Notes.
  2. Open the download, drag "Docker" to "Applications"
  3. Chose to "Replace" the existing installation
  4. Run Docker desktop

All your previous containers should still be there.

Ichthyosis answered 13/11, 2020 at 17:4 Comment(6)
It should prompt you but I had to reset to factory settings on mac to get the docker daemon to work again.Arrestment
Does this method retain the container? Or is it equivalent to uninstalling and then installing new/old instance?Barmaid
Containers are retained.Ichthyosis
Sadly, this no longer works. Now it only says "Existing installation is up to date".Perceptual
This works on Windows too.Weakkneed
Worked for me on MacOS 14.1 (x64)Atmosphere
T
25
  • Download a previous version from Release Notes
  • Open a terminal where the installer was downloaded and execute .\DockerDesktopInstaller.exe install --disable-version-check

This works for 4.X and above according to https://nickjanetakis.com/blog/docker-tip-92-rolling-back-to-a-previous-docker-desktop-version. I had problems with 4.23 and 4.24 by the way.

Theisen answered 3/10, 2023 at 18:43 Comment(4)
This seems like is a windows only solution, as the Mac download is a Docker.app with no installer involved. P.S. I'm trying to roll back from Mac Docker Desktop 4.24.2 to 4.24.0 as I'm suddenly getting intermittent docker network glitches and want to rule out the recent Docker Desktop update.Barium
This is the way! still works for rolling back to a previous version of Docker Desktop in 2024Contributory
This worked for me on Windows to downgrade from 4.27.1 to 4.26.1Cremate
This worked perfectly fine for me on Windows 10.Laetitia
T
7

Docker Desktop Options

If you're using Docker Desktop, I found deselecting the option Use Docker Compose V2 fixed my problems. Spent a long time working on reinstalling things. Definitely worth a try before doing anything big.

Teth answered 24/1, 2022 at 13:11 Comment(1)
I had problems whenever I changed something on my source code, the images were build but the containers were not replaced/restarted any more. By removing this settings this was fixed (Docker Desktop for Mac v 4.6.0)Placatory
N
3

[Answer 2022]

As said @patricknelson

Sadly, this no longer works. Now it only says "Existing installation is up to date".

And workaround of Docker Descktop downgrade with retains of the data described below:

  1. Get a list of containers

    docker container ls
    
  2. Commit the container to save the data:

    docker commit -p 64bf7c9f7122 new-image
    

    where 64bf7c9f7122 - id of my container

    new-image - new image name

  3. Save the committed image with changes to the archive

    docker save -o c:\backup.tar new-image
    
  4. Delete current Docker Desktop

  5. Install desired Docker Desktop version

  6. Unpacking the image in docker

    docker load -i c:\backup.tar
    
  7. run container

    docker run --name sample-container new-image
    

Congrats, all data saved and Docker downgraded 😃

Nonrecognition answered 24/5, 2022 at 12:33 Comment(0)
P
0

So, I run the installer of the previous Docker Desktop version: 2.2.0.5 - got a warning message stating that a newer Docker already exists and if I wanted to replace it (stop, or keep it both). I selected 'Replace'. The installation went successful. But when I open Docker all my running containers were gone. I run lando to recreate my Drupal 7 site. I got the "Boomshakala" from lando confirming that the app has started up correctly, and provided with its corresponding vitals -including the APPSERVER URLS. But when I access the URL, I got an error message: "Error: the website encounter an unexpected error. Please try again later." The uncaught exception thrown in shutdown function: "PDOException: SQLSTATE[]: Base table or view not found:1146 Table 'drupal7.semaphore' doesn't exist...."

To solve this, I imported and old copy of the drupal database site: lando db-import .sql

then I navigated to the docroot folder, and run a database update: lando drush upddatedb

All good now; thanks @halfer for your comments!

Prevot answered 5/6, 2020 at 19:0 Comment(0)
L
0

The quick hack here for Lando specifically, is just to reinstall Lando from the installer for the version you want. We've bundled the supported version of Docker Desktop with Lando itself which means you can always specifically install the supported version when installing Lando. This may wipe out your containers and volumes, so be careful!

Lunula answered 17/6, 2022 at 1:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.