How to display the installed Docker version

DockerDockerBeginner
Practice Now

Introduction

Docker is a popular containerization platform that has revolutionized the way developers build, deploy, and manage applications. Understanding the installed Docker version on your system is crucial for ensuring compatibility, troubleshooting, and staying up-to-date with the latest features and improvements.


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-411533{{"`How to display the installed Docker version`"}} docker/version -.-> lab-411533{{"`How to display the installed Docker version`"}} end

Understanding Docker Version

Docker is a popular containerization platform that allows developers to package their applications and all their dependencies into a single, portable container. Each Docker container is a self-contained environment that includes the application code, runtime, system tools, and libraries needed to run the application.

One of the key features of Docker is its ability to manage and control the versioning of the Docker platform itself. The Docker version number is an important piece of information that can help you understand the capabilities and features available in your Docker installation.

The Docker version number follows a semantic versioning format, which consists of three numbers: the major version, the minor version, and the patch version. For example, the version "20.10.14" would be interpreted as:

  • Major version: 20
  • Minor version: 10
  • Patch version: 14

The major version represents significant changes or updates to the Docker platform, such as the introduction of new features or the deprecation of old ones. The minor version represents smaller, incremental updates, while the patch version represents bug fixes and security updates.

Knowing the Docker version on your system is important for several reasons:

  1. Compatibility: Different versions of Docker may have different features and capabilities, so it's important to know which version you're using to ensure compatibility with your applications and any Docker-related tools or libraries you're using.

  2. Security: Keeping your Docker installation up-to-date is important for security, as newer versions often include bug fixes and security patches.

  3. Troubleshooting: If you encounter issues with your Docker setup, the version information can be helpful for troubleshooting and getting support from the Docker community or documentation.

In the next section, we'll explore how to check the Docker version on your system.

Checking Docker Version on Your System

There are several ways to check the Docker version on your system. The most common method is to use the docker version command.

Using the docker version Command

Open a terminal or command prompt and run the following command:

docker version

This will display the version information for both the Docker client and the Docker server (daemon). The output will look similar to the following:

Client: Docker Engine - Community
 Version:           20.10.14
 API version:       1.41
 Go version:        go1.16.15
 Git commit:        a224086
 Built:             Thu Mar 16 06:55:21 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          20.10.14
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.15
  Git commit:       a224086
  Built:            Thu Mar 16 06:53:57 2023
  OS/Arch:          linux/amd64
  Experimental:     false

The output shows the version information for both the Docker client and the Docker server. You can use this information to determine the capabilities and features available in your Docker installation.

Using the docker info Command

Another way to check the Docker version is to use the docker info command. This command provides more detailed information about your Docker installation, including the version information.

docker info

The output will include the Docker version information, along with other details about your Docker setup.

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
 Images: 0
 Server Version: 20.10.14
 Storage Driver: overlay2
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1.6.8
 runc version: v1.1.4
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
  SELinux
 Kernel Version: 5.15.0-46-generic
 Operating System: Ubuntu 22.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.756GiB
 Name: my-docker-host
 ID: ABCD:EFGH:IJKL:MNOP
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

The docker info command provides more comprehensive information about your Docker setup, including the server version, storage driver, and other configuration details.

Both the docker version and docker info commands can be useful for understanding the Docker version and capabilities on your system.

Practical Uses of Checking Docker Version

Knowing the Docker version on your system can be useful in a variety of situations. Here are some practical uses of checking the Docker version:

Compatibility and Feature Support

Different versions of Docker may have different features and capabilities. By checking the Docker version, you can ensure that your applications and Docker-related tools are compatible with the version of Docker you're using. This can help you avoid issues and ensure that your applications run smoothly.

For example, if your application requires a specific Docker feature that was introduced in a newer version, you can check the Docker version to ensure that your system meets the requirements.

Security and Vulnerability Management

Keeping your Docker installation up-to-date is important for security. Newer versions of Docker often include bug fixes and security patches. By checking the Docker version, you can ensure that you're using the latest version and take appropriate actions to update your Docker installation if necessary.

Troubleshooting and Support

If you encounter issues with your Docker setup, the version information can be helpful for troubleshooting and getting support from the Docker community or documentation. When reporting issues or seeking help, it's important to provide the Docker version information to help developers and support personnel understand your specific setup and provide more accurate assistance.

Automation and Scripting

In some cases, you may need to automate the process of checking the Docker version, for example, as part of a continuous integration (CI) or deployment pipeline. By using the docker version or docker info commands in your scripts, you can programmatically retrieve the Docker version information and use it to make decisions or take actions based on the version.

Monitoring and Reporting

Monitoring the Docker version across your infrastructure can be useful for tracking updates, identifying outdated installations, and generating reports. By regularly checking the Docker version, you can ensure that your Docker environments are up-to-date and identify any systems that need to be updated.

By understanding the practical uses of checking the Docker version, you can more effectively manage and maintain your Docker-based applications and infrastructure.

Summary

In this tutorial, you will learn how to display the installed Docker version on your system, as well as explore the practical uses of this information. By the end, you will have a better understanding of Docker versioning and how to leverage it to enhance your development workflow.

Other Docker Tutorials you may like