Fatskills
Practice. Master. Repeat.
Study Guide: Docker Docker Installation and Basics docker version docker info
Source: https://www.fatskills.com/kubernetes/chapter/docker-docker-installation-and-basics-docker-version-docker-info

Docker Docker Installation and Basics docker version docker info

By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.

⏱️ ~2 min read

1. Core Command / Concept

Get information about the Docker version and system configuration. docker version

2. Step-by-Step

  1. Open a terminal and check if Docker is installed.
    ```bash docker --version
   Output: Docker version information.
2. Get detailed information about the Docker version and system configuration.
```bash docker version

Output: Detailed Docker version and system configuration information.
3. Check the Docker system configuration.
bash docker info
Output: Detailed Docker system configuration information.
4. Clean up by removing all stopped containers.
⚠️ docker container prune

3. Real Commands with Examples


Example 1: Get Docker Version

  • Purpose: Get the Docker version.
  • Command: docker version
  • Brief explanation of flags: No flags required.

Example 2: Get Docker System Configuration

  • Purpose: Get detailed information about the Docker system configuration.
  • Command: docker info
  • Brief explanation of flags: No flags required.

Example 3: Get Docker Version with Build Information

  • Purpose: Get the Docker version with build information.
  • Command: docker version --buildkit
  • Brief explanation of flags: --buildkit flag enables buildkit.

4. Common Errors


Error 1: Docker Not Installed

Error message or symptom: docker: command not found
Why it happens: Docker is not installed.
One-line fix: sudo apt-get install docker.io

Error 2: Docker Not Running

Error message or symptom: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Why it happens: Docker is not running.
One-line fix: sudo systemctl start docker

Error 3: Docker Container Prune Failed

Error message or symptom: Error response from daemon: failed to remove container: cannot kill container: container is already dead
Why it happens: Docker container is already dead.
One-line fix: docker container rm

5. Quick Checks


Scenario 1: Docker Version

Situation: You want to check the Docker version.
Command to run: docker --version
Correct response: Docker version information.

Scenario 2: Docker System Configuration

Situation: You want to check the Docker system configuration.
Command to run: docker info
Correct response: Detailed Docker system configuration information.

Scenario 3: Docker Container Prune

Situation: You want to remove all stopped containers.
Command to run: docker container prune
Correct response: All stopped containers removed.

6. Last-Minute Reference

  • docker version command shows the Docker version.
  • docker info command shows the Docker system configuration.
  • docker --version command shows the Docker version.
  • docker info command shows the Docker system configuration.
  • docker container prune command removes all stopped containers.
  • --buildkit flag enables buildkit.
  • sudo systemctl start docker command starts the Docker daemon.
  • docker container rm command removes a dead container.
  • docker --version command shows the Docker version.
  • docker info command shows the Docker system configuration.


ADVERTISEMENT