Installing Docker Desktop on Ubuntu 22.04
I recently re-installed Ubuntu on my computer and hit a few snags when trying to install tools I used to use before I wiped the previous version of Ubuntu. The first was getting Rider running properly, I’ll write about that another day, and the second was getting Docker running.
Installing the Docker Engine
The previous times I used Docker on Linux I followed the instructions here. I added the required keys, repository, etc, and installed Docker using the command -
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin.
This was fine, but when I wanted to turn Docker completely off I had to run -
sudo systemctl stop docker.service ; sudo systemctl stop docker.socket ; sudo systemctl stop containerd.service
See these post-install instructions for more.
Installing the Docker Desktop
This time I wanted to use the Docker Desktop version, which is supposed to be easier to install. I downloaded the
.deb file and ran
sudo apt-get install ./docker-desktop-4.15.0-amd64.deb
I waited, and got an error!
The following packages have unmet dependencies: docker-desktop : Depends: docker-ce-cli but it is not installable
Notice that the missing package
docker-ce-cli is one of the packages I installed on my previous version of Ubuntu. Back to the instructions to add the required keys, repository, etc.
Here are the commands to set up the repository and install Docker Desktop -
sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install ./docker-desktop-4.15.0-amd64.deb # or whatever version you downloaded
And it worked!
Looking back at the instructions for installing Docker Desktop, there is a step “Set up Docker’s package repository”, though it is very easy to miss.
But that is the answer. Hope this helps someone else.