Containers are similar to VMs, except that while VMs create new kernels, containers typically share kernels and operating level resources with the host system. This results in faster boot times in exchange for lower levels of isolation.
- Concepts in container technologies
- Introduction of the Dockerfile
- Understand and use basic Docker commands
- Build, configure and deploy a container
- Optimising image specification files
Concepts and Introduction to Docker
Model of Container Technologies
There are three main entities in container technologies - the image specification, the image, and the container.
The image specification is a blueprint of what the image will contain. Developers run
docker build to create the image.
The image is a result of the build process. Think of images as logical classes which can then be instantiated by
docker run into a container.
Containers are basically instances of images, implying that multiple containers can be generated from an image.
Introduction to the Dockerfile
The Dockerfile is a directive based image specification file that tells Docker how an image should be built. Thus, the Dockerfile will contain some, all, or more of the following basic directives:
||Indicates which operating system we should be using|
||Specifies build-time only arguments|
||Specifies environment variables that persist after build-time|
||Indicates commands to be run when
||Copies files from your local machine into the image|
||Specifies the command to be run when the image is instantiated into a container.|
||Specifies the working directory - where the container should start from|
Understand Basic Docker Commands
Here are some basic CLI commands to get started. We will cover their practical use cases in the activites of this section. All of the following commands should be prefixed with
docker when executing in your terminal.
||Builds a Dockerfile|
||Lists all running containers|
||Lists all containers|
||Lists all networks|
||Lists all images|
||Lists all volumes|
||Shows statistics on all running containers|
||Instantiates an image into a container|
||Executes into a specified container|
Activity 1: Using an existing Docker Image
Click here for Activity #1.
Activity 2: Crafting a Dockerfile
Click here for Activity #2.
Click here to move onto Provisioning an Environment.