CodeBlanks Logo Icon CodeBlanks

Docker Desktop

Learn the features and use of Docker Desktop.

Docker Desktop

Docker Desktop is the package for Windows and macOS containing Docker Engine, the CLI, Docker Compose and an optional single-node Kubernetes. From the graphical interface you can see containers, images and volumes, and set resource limits (CPU, memory, disk).

On Windows, WSL 2 is used as the backend; Linux containers run in a lightweight virtual machine inside WSL.

wsl --install          # Windows: installing WSL 2 (administrator PowerShell)
docker compose version  # Compose also ships with Desktop

Switching with context

With Docker Desktop installed, the CLI can connect to several targets. docker context ls shows the saved targets; the starred one is active. Desktop's own context is called desktop-linux:

$ docker context ls
NAME              DESCRIPTION                     DOCKER ENDPOINT
default           Current DOCKER_HOST based ...   unix:///var/run/docker.sock
desktop-linux *   Docker Desktop                  unix:///home/ali/.docker/desktop/docker.sock
$ docker context use default

Practice Manage contexts

Write three commands that list the saved contexts, then switch to the desktop-linux context and finally print the Compose version.

Starter code

terminal
# buraya yaz

Sample solution

terminal
docker context ls
docker context use desktop-linux
docker compose version

Expected output

NAME              DESCRIPTION      DOCKER ENDPOINT
desktop-linux *   Docker Desktop   unix:///home/ali/.docker/desktop/docker.sock
desktop-linux
Docker Compose version v2.29.7

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is Docker Desktop's recommended backend on Windows?

  • A cloud server
  • WSL 2 Correct answer
  • VirtualBox
  • Directly on the kernel without Hyper-V

Explanation: WSL 2 runs a real Linux kernel.

2 Change the active context.

Question
docker context ____ desktop-linux
Answer
docker context use desktop-linux

Explanation: docker context use makes the chosen target active.

3 Match.

Term Meaning
Docker Desktop Windows/macOS package
WSL 2 Windows Linux layer
docker context ls Lists targets
docker compose Ships with Desktop

All lessons in Beginner