To install Docker on Mac or Windown, visit https://docs.docker.com/install and download the lastest stable version of Docker Desktop for your operating system.
For a Linux operating system, Docker provides a very convenient script to install Docker with just a couple of commands:
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
You can test whether you Docker installlation is working correctly using the command:
docker run hello-world
Introduction to Docker Images
Docker images are built based on a Dockerfile. Each line in a Dockerfile starts with one of a few clauses. The most important are:
FROM: Indicates the Docker base container to build from. We will always want to use this clause. There are many base containers available to download, such as ubuntu.
RUN: Runs bash. This is the bread and butter of most Docker images. This is where we want to do package installations, directory creation, etc. Because each line will create a layer in the image, it's good to have package installations and other long tasks as one of first lines in Dockerfile. This means that during rebuilds, Docker will try to use layers from the cache.
ARG: Build arguments. It's useful if you want to have multiple flavors of the same image, for example dev and production
COPY: Copies files from a context. The path to the context is an argument used in docker build.
Description
Actions
Estimate
Tests