Week 5 - Containers & CI/CD

Introduction to Containers and CI/CD

Dependency Management

Docker Fundamentals

Azure Container Registry

Python CI Pipeline

Week 5 Gotchas & Pitfalls

Practice

Week 5 Assignment: Containerize and Ship a Data Pipeline

Week 5 Lesson Plan

Week 5 Lesson Plan

This week moves students from local scripts to deployable artifacts. The focus is on reproducibility, containerization, and CI automation.

Goals

By the end of this lesson, students should be able to:

Explain* why containers solve the "works on my machine" problem.

Write* a basic Dockerfile for a Python pipeline.

Run* a container locally with environment variables.

Read* a GitHub Actions workflow and identify its steps.

Push* a container image to Azure Container Registry.

Schedule

Time Activity Duration
0:00 Welcome and recap of Weeks 1 to 4 10 min
0:10 Concept intro: containers and CI/CD 15 min
0:25 Live demo: build and run a Docker image 20 min
0:45 Break 10 min
0:55 Workshop: write a Dockerfile in pairs 25 min
1:20 Mini-lab: log in to ACR, tag and push an image 15 min
1:35 CI walkthrough: GitHub Actions workflow 15 min
1:50 Assignment overview and Q&A 10 min
2:00 End -

Total: 2 hours


Preparation (before class)

az acr create --resource-group rg-data --name hyfregistry --sku Basic
az ad sp create-for-rbac \\
  --name "github-ci-team-1" \\
  --role AcrPush \\
  --scope $(az acr show --name hyfregistry --query id --output tsv)
az role assignment create \\
  --assignee <student-email> \\
  --role AcrPush \\
  --scope $(az acr show --name hyfregistry --query id --output tsv)

Live Demo: Docker Fundamentals

Goal: Show a reproducible build.

  1. Create a minimal Python script.
  2. Write a Dockerfile.
  3. Build and run the container.
  4. Pass an env var at runtime.

Workshop: Dockerfile Authoring

Goal: Students write a Dockerfile in pairs.

  1. Provide a starter requirements.txt.
  2. Require correct ordering for caching.
  3. Add a .dockerignore.

CI Walkthrough

Goal: Connect tests to automation.

  1. Show .github/workflows/ci.yml.
  2. Explain triggers and jobs.
  3. Run a failing test to show CI feedback.

Assignment Overview

Goal: Map the chapters to assignment steps.


The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with ❤️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.