A CLI to Linux capabilities and interfaces that we use to build, start and stop application containers. User:Maklaan, Public domain, via Wikimedia Commons
Use cases
Packaging and vendoring of complex dependencies.
Developer productivity.
Lightweight "virtualisation".
Running unit tests and CI pipelines.
Images, containers
An image is a read-only file that contains all dependencies that an application needs to run (e.g. glibc, python, flask, nginx, bash).
A container is a run-time environment (atop Linux capabilities) on which applications (and their deps) run isolated from the host OS while sharing the same kernel.
Docker Hub is an online repository of images, that can be fetched to run containers.
Hello world
docker run hello-world
What did just happen?
Explore a Unix inspired cli: docker ps|cp|kill|help.
Writing our own image
Before we pulled an existing image. Now we'll write on from scratch.
We first need to define a Dockerfile with the required deps. It contains instructions to build Docker images.
We then build an image with docker build -t hello-pythonic-world .
And finally run a container with docker run hello-pythonic-world.