Lesson 2: Setting Up Your Docker Environment
Before we start building, we need to install Docker Desktop, which bundles all the necessary tools for development on Windows, macOS, and Linux.
Docker Desktop Installation
Docker Desktop includes the Docker engine (daemon), the Docker CLI (client), Docker Compose, and Kubernetes (optional).
- Download: Go to the official Docker website and download the installer for your operating system.
- Installation: Follow the platform-specific instructions.
- (Note for Windows users: You may need to enable WSL 2 and/or Hyper-V.)
- Launch: Start Docker Desktop. You should see the Docker whale icon in your system tray.
Verifying the Installation
Open your terminal (Command Prompt, PowerShell, or Bash) and run the following command to check the Docker version:
bash docker --version
You should see output similar to:
Docker version 24.0.5, build 337b51b
Next, verify that the Docker daemon (engine) is running by executing a basic command:
bash docker run hello-world
Expected Output
If the installation was successful, Docker will:
- Search for the
hello-worldimage locally. - Not find it, so it will pull it from Docker Hub (the default registry).
- Create a container from that image.
- Run the application inside the container, printing a message that confirms your installation is working.
This simple command confirms that both the Docker client (CLI) and the Docker daemon (engine) are communicating correctly.