Docker

Duration: 3 days

Students should be familiar with general principles of software development. Some basic knowledge of software systems such as databases, web servers, etc is also required. Not a requirement, but having basic linux operating skills is very helpful. No prior knowledge of docker is required.

Please find the course objectives below:

Introduction

  • Introduction to docker
  • Docker history
  • What problems does docker solve
  • Benefits of using docker
  • Understand container isolation
  • Docker vs virtual machines
  • How docker facilitates devops
  • Installing Docker CE

Docker Containers

  • Deeper dive into container isolation
  • Introduce Images and the relation with containers
  • Linux Namespaces (PID, UTS, NET, etc) and containers
  • Understand ephemeral containers
  • Discuss the various states of a container (Created, Up, Paused, …)
  • Running and Stopping containers
  • Run detached containers in the background
  • Managing containers (listing, removing, inspecting, killing, pausing, restarting)
  • Discuss go-templates for inspecting containers
  • Interactive containers
  • Executing commands in running containers
  • Copying files and directories to and from containers
  • How to Expose (and map) network ports

Docker Images

  • Introduce image repositories (Docker Hub, Quay.io)
  • Appreciate that image are immutable
  • Managing images (listing, removing, inspecting)
  • Fully understand image layers (including intermediate)
  • List different ways to create images
  • Docker images FROM scratch
  • Creating base images (e.g, Debian)
  • Building an image from Containers
  • Using Multi-stage builds

Creating and Using Docker Files

  • Understand the syntax of a Dockerfile
  • Choosing and specifying a base image
  • Adding *meta-data
  • Understand the build process
  • Understand the build context
  • Introduce dockerignore` files
  • How to optimise reusing of layers
  • Running commands effectively
  • Understand shell-form and exec-form when running commands
  • Keeping your builds deterministic
  • Copying files and directories
  • Difference between COPY and ADD
  • Understand the working directory (and changing it)
  • Defining network ports
  • Changing the container's environment
  • Building executable containers
  • Understand how to yse ENTRYPOINT and CMD
  • Best practices in creating images
  • Using traditional build containers
  • Using multi-stage build files

Data Volumes

  • Understand the need for data volumes
  • Introduce the volume architecture
  • Creating and inspecting volumes
  • Sharing data
  • Using the volume CLI
  • Use mount binding
  • Binding to the local file-system
  • Binding to named volumes
  • Mounting tmpfs
  • Using legacy Volume Containers
  • Mounting options (read-only, selinux labels, )
  • Using NFS
  • Using volumes for databases (Postgres, MongoDB, …)

Networking

  • Understand docker's networking architecture
  • List different network types (bridge, host, none, overlay and macvlan)
  • Introduce the Docker Network CLI
  • *Managing networks (listing, inspecting, …)
  • Understand the problems of the default bridge network
  • Discuss and use the deprecated container links
  • Creating a custom bridge networks
  • Connecting containers to a network
  • Use of DNS inside a custom network
  • Registering additional domain names for a container
  • Connecting to multiple networks
  • Managing container's /etc/hosts

Container Management

  • Container restart policies
  • Constrain container's memory
  • Constrain container's CPU resources
  • Setup a self-hosted repository
  • Understand the relation between image names and repository
  • Pulling and Pushing images
  • Understand docker container logging
  • Log configuration
  • Using different logging drivers
  • Setup fluentd/elasticsearch with kibana
  • Setup cAdvisor and Prometheus

Docker Compose

  • Introduce docker-compose
  • introduction to the yaml syntax
  • Writing docker-compose.yaml files
  • configuring containers inside compose
  • Understand networks in compose
  • Setting up links between services
  • configuring volumes inside compose
  • Setting up a CI/CD-Pipeline using containerised GitLab and Jenkins
For an onsite course please contact us