Did you Know? Docker Desktop for Linux was the second-most-popular issue on Docker’s public roadmap. The feature request was first raised in GitHub by Darragh Grealish (Community Enthusiast and Arm Innovator) in March 11, 2020. Thanks to Docker team for introducing this most awaited product in Dockercon 2022.
Why Linux developers need Docker Desktop?
One common reason why Linux developers were waiting for this product was to have unified Docker experience across all major operating systems, be it Ubuntu(DEB), Red Hat(RPM) or Arch Linux(Pacman). Installing and maintaining Docker binaries on all these diverse Linux platform is still painful. Keeping up the latest Docker releases still require refreshing repository indexes and ensuring that the system packaging management doesn’t break.
With this new product offering, it’s always easy to keep your Docker version up-to-date and officially supported by Docker Team. The new Docker Desktop UI makes it so much easier to manage volumes, containers and images, as well as providing insights in to the Docker processes running locally on your machine.
Not only this, Docker Desktop allows you to run Kubernetes too. Installing Kubernetes is still not an easy task, that’s the reason why we have multitude of Kubernetes tools available in the market to make it seamless. Thanks to Docker Desktop, now you don’t really need to rely on 3rd party tool to install and maintain the latest version of Kubernetes on your desktop system.
In this blog post, you will see how to get started with Docker Desktop for Linux for the first time.
Download the correct package for your Linux distribution and install it with the corresponding package manager.
I have Ubuntu 22.04 installed on my HP Pavilion, hence I will go ahead and download the latest Docker Desktop 4.8.1 DEB package for my system.
Step 1. Setting up Docker’s package repository
Run the following command to update the apt package index:
sudo apt update
Install packages to allow
apt to use a repository over HTTPS.
Step 2. Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings Added: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Step 3. Set up the Repository
echo \ Added: "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ Added: $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 4. Update the Repository Index
sudo apt update
Step 5. Install Docker Desktop
apt install ./docker-desktop-4.8.2-amd64.deb
Once the installation gets completed, you will see the following window displaying Docker Desktop v4.8.2 with Docker Engine 20.10.4 and Kubernetes v1.24.0 already installed for you.
Upgrading the Docker Desktop
In case you want to upgrade the Docker Desktop, click on “Whale icon”. Click on “Updates” and then it will allow you to download the latest package in your system. You just need to run the same
apt install command to upgrade it to the latest release.
Using Docker Desktop UI
The Docker Preferences menu allows you to configure your Docker settings such as installation, updates, version channels, Docker Hub login, and more.
Choose the Docker menu > Preferences from the menu bar and configure the runtime options described below.
On the General tab, you can configure when to start Docker and specify other settings:
Start Docker Desktop when you log in: Automatically starts Docker Desktop when you open your session.
Send usage statistics: Docker Desktop sends diagnostics, crash reports, and usage data. This information helps Docker improve and troubleshoot the application. Clear the check box to opt out.
Show weekly tips: Displays useful advice and suggestions about using Docker.
Open Docker Desktop dashboard at startup: Automatically opens the dashboard when starting Docker Desktop.
Use Docker Compose V2: Select this option to enable the
docker-composecommand to use Docker Compose V2. For more information, see Docker Compose V2.
Dev Environments feature is supported in Docker Desktop for Linux. Dev Environments enable you to collaborate easily by allowing you to share work-in-progress code with your team members. When using Dev Environments, you can easily set up repeatable development environments, keeping the environment details versioned along with your code. You can also share your work-in-progress code with your team members in just one click and without having to deal with any merge conflicts while moving between Git branches to get your code on to their machine.
Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration that runs on your machine. The Kubernetes server runs locally within your Docker instance, is not configurable, and is a single-node cluster.
To enable Kubernetes in Docker Desktop, go to Preferences > Kubernetes and then click Enable Kubernetes.
Click Apply & Restart to save the settings and then click Install to confirm. This instantiates images required to run the Kubernetes server as containers, and installs the
/usr/local/bin/kubectl command on your machine.
Using Docker Extensions Marketplace
Docker Extensions lets you use third-party tools within Docker Desktop to extend its functionality. There is no limit to the number of extensions you can install. Docker Extensions is available as part of Docker Desktop 4.8.0 or a later release.
With the new Docker Desktop v4.8.0+, the Extensions SDK makes it easy for you to create your own custom Docker Desktop functionalities. You can create and install an extension in minutes with the Extensions CLI, and use predefined commands to build your extension for multiple architectures, share it with your team, and publish it on Docker Hub. Amazing, isn’t it?
There are 16 initial Docker Extensions made available by Docker, Inc that are listed below:
- Ambassador Telepresence
- Anchore – Content and security analysis for container images
- Aqua Trivy
- Disk Usage
- Logs Explorer
- VMware Tanzu Community Edition
Let us try installing Disk Usage that will help us optimize disk space by removing unused objects from Docker Desktop.
- Open Docker Desktop.
- From the Dashboard, select Add Extensions in the menu bar. The Extensions Marketplace opens.
- Browse the available extension, choose Disk Usage.
- Click Install.
From here, you can click Open to access the extension or install additional extensions. The extension also appears in the menu bar.
Docker Extensions are made available in the form of Docker images, hence the reason why you can see it available under Images section in the Dashboard UI.
Click on “Disk Usage” on the left sidebar to see the reclaimable space.
Click “Reclaim space” to clean up unused objects from Docker Desktop.
Logs Explorer in Docker Extensions Marketplace
If you want to see what happens behind the scene when Kubernetes is enabled under Docker Desktop for the first time, then try out Logs Explorer Docker Extension. With a single click, you ca install it using Docker Extensions Marketplace and view the logs and troubleshoot as shown in the following screenshot.