Skip to content

Gepardec/containerization-training

Repository files navigation

Training

The training covers the following containerization topics:

  1. Introduction to Containerization We compare containerization to virtualization and discuss the advantages of containerization compared to virtualization.

  2. Containerization Basics We discuss the Linux technologies such as namespaces, which are used by containerization and that a container is nothing but a isolated process on the host.

  3. Creating Images We discuss what container images are, how they are set up, and how to build container images efficiently.

  4. Container Volumes We discuss how to store persistent data of containers in volumes, how the volumes work, and how to use them efficiently.

  5. Docker System Commands We discuss the system commands Docker provides, for instance for housekeeping.

  6. Container Networking We discuss the container networking model, the different types of networks, and how to use container networks properly.

  7. Docker-Compose We discuss composing multiple service with Docker-Compose.

The objective of this training is that trainees understand containerization with Docker and can use containerization in there daily work.

Training resources

We provide the following resource for this training which can be downloaded from this repositories releases or viewed as github pages.

The release archive contains the following resources.

  • presentation
    A asciidoc/revealjs based HMTL presentation

  • exercises
    Asciidoc based HTML with the exercises

  • instructor
    Asciidoc based HTML with the instructor demos

  • resources
    Additional resources for the training such as exmaple applictions

Training environment

The training environment will be provided to by your trainer, and is used for hands on with Docker. You will connect to the environment via ssh, whereby the ssh public key will be provided to you, and is only valid for the provisioned environment during the training.

Connect to your environment.
ssh ubuntu@<PROVIDED_AWS_URI> -i <PROVIDED_PUBLIC_KEY>
Copy a directory to the environment.
scp -r <LOCAL_DIR_PATH> buntu@<PROVIDED_AWS_URI>:<REMOTE_PATH> -i <PROVIDED_PUBLIC_KEY>
Copy a directory from the environment.
scp -r buntu@<PROVIDED_AWS_URI>:<REMOTE_PATH> <LOCAL_DIR_PATH> -i <PROVIDED_PUBLIC_KEY>

Trainer

This section is for trainers only, and documents how to prepare for a training.

Render Presentation/Exercises

The presentation and exercises are asciidoc resources whereby the presentation can be rendered to PDF via a http-server and a chromium browser.
The exercises can be printed via a browser as any other website.

Note
All following commands must be either executed in the directory /presentation or /exercises.

If Node is installed

Get dependencies
npm update
Converts asciidoc to HTML
node convert.js

If you want to use Docker

Get dependencies

docker run --rm \
-v $(pwd):/home/node \
-w /home/node node:latest \
npm update
Render to HTML
docker run --rm \
-v $(pwd):/home/node \
-w /home/node node:18.7.0 \
convert.js

HTML to PDF

This applies only for the presentation.

  1. Start webserver

With node installed
node_modules/http-server/bin/http-server
With Docker
docker run --rm \
-v $(pwd):/home/node \
-p 8080:8080 \
-w /home/node node:18.7.0 \
node_modules/http-server/bin/http-server
  1. Open in Chrome/Chromium browser http://localhost:8080/presentation?print-pdf or http://localhost:8080/exercises?print-pdf

  2. Open Chrome browser print dialog and save as pdf.

Provision an training environment in AWS

We use AWS to provision a training environment, which is based on this git repository which provides a container image which uses Terraform to provision the training environment. These Github Pages provide the documentation how our provisioning in AWS works.

You need Docker, an active AWS account and a set up AWS CLI on the host you want to provision the environment from.

Note
All of the following commands must be executed in the /aws directory.
Provision an training environment
docker run --rm -it \
-v $(echo ~)/.aws:/root/.aws:ro \
-v $(pwd):/opt/train/workdir \
-v $(pwd)/bootstrap.sh:/opt/train/terraform/files/bootstrap/bootstrap.sh \
gepardec/train:latest apply
De-provision an training environment
docker run --rm -it \
-v $(echo ~)/.aws:/root/.aws:ro \
-v $(pwd):/opt/train/workdir \
-v $(pwd)/bootstrap.sh:/opt/train/terraform/files/bootstrap/bootstrap.sh \
gepardec/train:latest destroy