Docker Version vs Docker Info Command Explained
Mastering foundational Docker diagnostic tools is essential for maintaining healthy containerized environments. This chapter examines two critical inspection commands—docker version and docker info—which serve as fundamental utilities for DevOps troubleshooting, system verification, and production server auditing.
1. Why Do We Need Inspection Commands?
When working with containers, developers often rely on basic status checks or simple shorthand flags like docker -v. However, modern containerized applications require deep visibility into underlying system components, API compatibilities, storage drivers, and resource allocations.
- DevOps Troubleshooting: Rapidly diagnose version mismatches between client tooling and the Docker daemon.
- Production Server Auditing: Inspect hardware resource limits, active storage drivers, and runtime configurations across remote cluster nodes.
- Environment Verification: Confirm active context targets (e.g., local Docker Desktop versus remote cloud daemons).
2. Core Mental Model: The Inspector Analogy
Think of docker version and docker info as a comprehensive medical checkup for your container environment:
docker versionacts like an ID and License Check, verifying the exact build versions, API compatibility layers, and programming language runtimes (such as Go) powering your toolchain.docker infoacts like a Full Body Scan, inspecting real-time vital statistics, resource consumption (CPU and memory), active container counts, storage drivers, and network configurations.
3. Deconstructing the docker version Command
Executing docker version in your terminal outputs a detailed multi-tier report split into distinct functional sections. Let's analyze each segment in detail.
A. The Client Section
The client section describes the local command-line interface (CLI) tool being executed by the user.
- Client Version: Indicates the installed release version of the Docker CLI (e.g.,
27.4.0). - API Version: The version of the Docker API utilized by the client to communicate with the Docker daemon.
- Go Version: The Go programming language version used to compile the client binary.
- Git Commit: The specific source code commit hash associated with the client build.
- OS/Arch: The operating system and CPU architecture of the client machine (e.g.,
darwin arm64for Apple Silicon). - Context: The active Docker context defining which environment the CLI is currently interacting with (e.g.,
docker-desktop).
B. The Server Section (Docker Daemon)
The server section provides telemetry regarding the background daemon executing container operations.
- Engine Version: The installed version of the Docker Engine (e.g.,
27.4.0). - API Version (Server): The API version supported by the daemon alongside minimum client compatibility thresholds (e.g., server API
1.47, minimum client API1.24). - Go Version (Server): The Go version used to compile the daemon binary.
- Experimental Flag: Indicates whether experimental features are enabled (
falseby default).
C. Runtime Components
Docker relies on industry-standard low-level utilities to manage container lifecycles. docker version exposes their underlying versions:
4. Deconstructing the docker info Command
While docker version focuses on software binary versions, docker info provides a comprehensive runtime telemetry report of your entire Docker host environment.
A. Container and Image Statistics
The server subsection within docker info provides an immediate quantitative overview of local artifacts:
- Total Containers: Aggregate number of containers created on the system.
- Running Containers: Number of active, running instances.
- Paused Containers: Containers suspended via
docker pause. - Stopped Containers: Inactive containers retaining local state.
- Images: Total number of Docker images stored locally.
B. Storage and Logging Drivers
Docker abstracts how container layers and logs are written to disk through configurable drivers:
C. Networking and Volume Drivers
docker info lists available volume and networking plugins installed on the host. By default, Docker supports multiple networking modes:
- Bridge: Default private network for standalone containers.
- Host: Shares the host machine's network stack directly.
- Overlay: Connects multiple Docker daemons across a swarm cluster.
- Null / None: Disables networking entirely for the container.
- Macvlan: Assigns a MAC address to a container, making it appear as a physical device on your network.
5. System Hardware and Storage Architecture
Scrolling further down in the docker info output reveals deep infrastructure telemetry regarding the host machine:
- Kernel & OS: Displays the underlying host Linux kernel version and operating system distribution (e.g., Ubuntu, RedHat, or Docker Desktop Linux VM).
- Hardware Resources: Exposes available capacity allocated to container workloads, such as total CPU core count (
8 CPUs) and total allocated memory (~3.8 GB). - Docker Root Dir: The primary storage path on the host where Docker persists images, containers, volumes, and networks (typically
/var/lib/dockeron Linux or managed storage paths on macOS/Windows desktop environments). - Registry Configuration: Displays insecure registry configurations or mirror proxies (such as
hub-proxy.docker.internal) allowing HTTP communication without strict TLS enforcement.
6. Command Comparison Reference
To solidify your understanding, review the functional differences between the two primary inspection commands:
7. Summary and Key Takeaways
docker versioninspects installed binaries, client-to-daemon API compatibility, and compiled Go runtime versions.docker infoprovides a comprehensive telemetry report detailing system hardware resources, container counts, and storage configurations.- DevOps Troubleshooting relies on these commands to quickly identify version mismatches or misconfigured daemon environments.
- Production Auditing uses
docker infoto verify active storage drivers likeoverlay2and inspect available CPU and memory allocations. - Runtime Components such as
containerdandruncare exposed directly in version outputs, explaining how Docker manages container lifecycles under the hood. - Docker Root Directories (
/var/lib/dockeror desktop equivalents) store all local images, volumes, and container layers managed by the daemon. - Default Networking Modes including Bridge, Host, and Overlay are initialized and managed directly by the underlying Docker engine runtime.