Table of Contents
You’ve seen how to use a docker image directly using
and using a
docker-compose.yml file. Both methods do the same thing,
which is to create a container from a Docker image. Now, let’s take a
look at how to build a Docker image.
Let’s review some Docker terms before we continue. These terms are from dotnet doc's terminology page. See additional terms and examples on page A Practical Introduction to Docker Container Terminology provided by Redhat.
A package with all the dependencies and information needed to create a container.
A container represents a runtime for a single application, process, or service. It consists of the contents of a Docker image, a runtime environment, and a standard set of instructions. When scaling a service, you create multiple instances of a container from the same image. Or, a batch job can create multiple containers from the same image, passing different parameters to each instance.
A read-only instance of a Docker image.
A container represents the execution of a single application, process, or service. It consists of the contents of a Docker image, an execution environment, and a standard set of instructions. When scaling a service, you create multiple instances of a container from the same image.
A writable filesystem that the container can use.
Images are read-only but most programs need to write to the filesystem. Volumes add a writable layer on top of the container image so that programs can access a writable filesystem.
A text file that contains instructions for how to build a Docker image.
The action of building a container image using the information in a Dockerfile.
A mark or label that you can apply to images for identification.
- Repository (repo)
A catalogued or indexed collection of Docker images.
A service that provides access to repositories.
The default registry for most public images is Docker Hub (owned by Docker as an organization).
- Docker Hub
A public registry of images.
Dockerfileuse images from Docker Hub. For example,
nextcloudfrom Docker Hub before it creates the container using this command:
docker run -d -p 80:80 nextcloud.
- Multi-arch image
An image designed for multi-architecture systems.
A command-line tool and YAML file format with metadata for defining and running multi-container applications.