OTLab Documentation

This documentation describes the steps required to configure the environment for running OTLab laboratories using Docker. It also presents the basic management commands and the overall project structure.

Requirements

Before starting, make sure you have installed:

  • Git
  • Docker Engine
  • Docker Compose
  • WSL2 (recommended for Windows users)
  • Visual Studio Code (optional)

Docker Installation (Ubuntu / WSL2)

Update the system:

sudo apt update && sudo apt upgrade -y

Install dependencies:

sudo apt install -y ca-certificates curl gnupg

Add the official Docker repository:

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker Engine and Docker Compose:

sudo apt update

sudo apt install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin

Start Docker:

sudo service docker start

Allow Docker to run without sudo:

sudo usermod -aG docker $USER
newgrp docker

Verify installation:

docker --version
docker compose version

Clone the Repository

git clone https://github.com/substationworm/OTLab.git
cd OTLab

Run a Laboratory

Each laboratory includes its own management script.

Example for OTLab01:

cd OTLab01
chmod +x OTLab01.sh

./OTLab01.sh -start ubuntu
./OTLab01.sh -run

Management Commands

CommandDescription
./OTLab01.sh -start ubuntuStarts the laboratory
./OTLab01.sh -runOpens a terminal inside the otlab-student container
./OTLab01.sh -statusDisplays the current container status
./OTLab01.sh -stopStops the containers
./OTLab01.sh -restartRestarts the containers
./OTLab01.sh -cleanRemoves containers, volumes, and networks

Note: The script name changes depending on the laboratory (OTLab02.sh, OTLab03.sh, etc.).

Repository Structure

β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── hugo.yml
β”‚
β”œβ”€β”€ .landingPage/
β”‚   β”œβ”€β”€ archetypes/
β”‚   β”œβ”€β”€ content/
β”‚   β”œβ”€β”€ i18n/
β”‚   β”œβ”€β”€ layouts/
β”‚   β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ hugo.yaml
β”‚   β”œβ”€β”€ README.md
β”‚   └── CONTRIBUTING.md
β”‚
β”œβ”€β”€ OTLab01/
β”œβ”€β”€ OTLab02/
β”œβ”€β”€ OTLab03/
β”œβ”€β”€ OTLab04/
β”œβ”€β”€ OTLab05/
β”œβ”€β”€ OTLab06/
β”œβ”€β”€ OTLab07/
β”œβ”€β”€ OTLab08/
β”œβ”€β”€ OTLab09/
β”œβ”€β”€ OTLab10/
β”œβ”€β”€ OTLab11/
β”œβ”€β”€ OTLab12/
β”œβ”€β”€ OTLab13/

The .landingPage folder contains all Hugo website code, including layouts, content, translations and static assets.

Each OTLabXX folder contains the laboratory Markdown files, translated versions, automatically generated PDFs and execution scripts associated with the corresponding laboratory environment.

CI/CD

The website is automatically generated using GitHub Actions.

The pipeline performs:

  • Hugo website build;
  • Automatic generation of laboratory PDFs;
  • Automatic deployment to GitHub Pages;
  • Website updates after changes are pushed to the main branch.