πŸŽ“ A1Learner
πŸ”
0 of 50 lessons completed

What Is Docker?

Docker is a tool that packages an app with everything it needs to run. The same package runs the same way on any machine with Docker.

Check that Docker is installed

One command shows the Docker version on the machine.

docker --version

See the client and the server

Docker has two parts. This command shows both versions.

docker version --format "Client: {{.Client.Version}} Server: {{.Server.Version}}"

Example

docker run hello-world

Key points

  • Package: one file set that holds an app plus its libraries and settings.
  • Use Docker to ship an app that behaves the same everywhere it runs.
  • Docker runs the package in a container, an isolated space on the machine.
  • The package is called an image, and the running image is called a container.
  • Docker removes the "works on my machine" problem at its root.

In this example, Docker runs a tiny test image called hello-world. The image prints Hello from Docker! and then stops. The short output proves Docker is installed and working. Later lessons read the full output line by line.

Note

Docker is a tool, not a language. It runs apps written in any language.

Try it Yourself

Edit the code, then press Run.

Running is simulated Β· Rust Playground

Exercise

What does Docker package together with an app?