How to use docker desktop update command to manage updates

DockerDockerBeginner
Practice Now

Introduction

In this lab, we will explore how to manage updates for Docker, focusing on the underlying Docker Engine as Docker Desktop is not installed on the LabEx VM. We will learn how to check for available updates without immediately applying them, simulating the process using standard Docker commands like docker version and docker info to understand the current installation and daemon status.

Furthermore, we will delve into the process of quietly checking for and applying updates to the Docker Engine using the system's package manager, specifically apt for the Debian-based LabEx environment. This will demonstrate the typical workflow for updating Docker Engine on a Linux server, providing practical experience with command-line update procedures.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL docker(("Docker")) -.-> docker/SystemManagementGroup(["System Management"]) docker/SystemManagementGroup -.-> docker/info("Display System-Wide Information") docker/SystemManagementGroup -.-> docker/version("Show Docker Version") subgraph Lab Skills docker/info -.-> lab-555151{{"How to use docker desktop update command to manage updates"}} docker/version -.-> lab-555151{{"How to use docker desktop update command to manage updates"}} end

Check for Docker Desktop updates without applying them

In this step, we will learn how to check for Docker Desktop updates without automatically applying them. While Docker Desktop is not installed on the LabEx VM, the underlying Docker Engine is. We can simulate checking for updates by using Docker commands that interact with the Docker daemon.

First, let's check the current version of Docker installed on the system. This is a good practice to know what version you are currently running before looking for updates.

docker version

The output will show details about the Docker client and server (daemon) versions.

Now, to simulate checking for updates without applying them, we can use the docker info command. This command provides detailed information about the Docker daemon, including information that might indicate if updates are available or how the update process is configured. While it doesn't explicitly say "update available," it gives insight into the daemon's status and configuration related to updates.

docker info

Examine the output of the docker info command. Look for sections related to the Docker daemon's configuration, especially anything that might hint at update channels or versions. This command is a powerful tool for understanding the state of your Docker installation.

Quietly check and apply Docker Desktop updates

In this step, we will explore how to quietly check for and apply updates to the Docker Engine. While Docker Desktop has a graphical interface for updates, the Docker Engine on a Linux server is typically updated using the system's package manager. We will simulate this process.

First, let's understand that updating Docker Engine on a Linux system usually involves using commands like apt (for Debian/Ubuntu based systems) or yum/dnf (for Red Hat based systems). The LabEx VM uses a Debian-based distribution, so we will use apt.

To quietly check for updates, you would typically update the package lists without upgrading the packages themselves. This fetches the latest information about available packages, including Docker.

sudo apt update

This command updates the list of available packages and their versions from the repositories. It runs quietly in the sense that it doesn't prompt you to install anything, it just updates the information.

After updating the package lists, you can see if a newer version of Docker is available by checking the package information.

apt list --upgradable | grep docker-ce

This command lists all packages that can be upgraded and filters the output to show only lines containing "docker-ce", which is the package name for Docker Engine Community Edition. If there is output, it means a newer version is available.

To quietly apply the update, you would use the apt upgrade command with the -y flag. The -y flag automatically answers "yes" to any prompts, making the upgrade process non-interactive or "quiet".

sudo apt upgrade -y docker-ce

This command will upgrade the docker-ce package to the latest version available in the repositories. The -y flag ensures that the upgrade proceeds without requiring user confirmation.

After the upgrade is complete, it's a good idea to verify the Docker version again to confirm that the update was successful.

docker version

Compare the output of this command with the output from the previous step to see the updated version number.

Summary

In this lab, we learned how to interact with the Docker Engine to simulate checking for and applying updates, even though Docker Desktop was not installed. We started by checking the current Docker version using docker version to understand our starting point. Then, we used the docker info command to gain insights into the Docker daemon's configuration, which can indirectly indicate update-related information, simulating checking for updates without applying them.

We also explored the process of quietly checking for and applying Docker Engine updates on a Linux system, understanding that this is typically done using the system's package manager like apt. This simulated the command-line approach to managing Docker Engine updates, contrasting with the graphical interface of Docker Desktop.