Container foundations
Install and verify Docker
Install a current Docker toolchain for your operating system and verify the client can reach the Docker engine.
To follow this course you need Docker running on your machine.
On macOS and Windows, install Docker Desktop. On Linux, install Docker Engine from Docker’s own package repository, not the version your distribution ships, which is often old. Follow the official instructions for your operating system, since they change over time.
A client and a server
The docker command you type in the terminal is only a client. It doesn’t create containers by itself. It sends requests to a long-running program, the Docker engine (also called the daemon), and the engine does the work: pulling images, creating containers, networks, and volumes.
This matters when things break. You can have a perfectly working docker binary and still be unable to run anything, because the client can’t reach the engine.
Three commands to verify the install
Run these in order:
docker version
docker info
docker run --rm hello-world
Each one tests a different piece of the path.
docker version prints two sections, Client and Server. If you see both, the client managed to talk to the engine. If you only see Client, plus an error like Cannot connect to the Docker daemon, the engine is not reachable.
docker info asks the engine for its configuration: how many containers and images it has, the storage driver, the operating system it runs on. It’s a good way to confirm you’re talking to the engine you think you are.
docker run --rm hello-world does the full round trip. Docker looks for an image called hello-world, doesn’t find it locally, downloads it from Docker Hub, creates a container, runs it, shows its output, and removes it thanks to --rm. If you see the “Hello from Docker!” message, everything works.
When the server is missing
The most common problem on a fresh install is the client not finding the engine.
On Docker Desktop, check that the application is actually running. The menu bar or system tray icon should say the engine is running. Nothing works until it does.
On any system, run:
docker context show
A context tells the client which engine to talk to. The default one is called default, but Docker Desktop creates its own, desktop-linux. If the client points at a context whose engine isn’t running, you get a connection error even though nothing is broken. Switch with docker context use <name> before reinstalling anything.
My advice: don’t stop at checking that the docker executable exists. Run docker version and read both sections. That’s the real test.
Lesson completed