Skip to content

Commit 4959df3

Browse files
committed
Add new guides for all of the new labspaces
1 parent 3468294 commit 4959df3

11 files changed

Lines changed: 498 additions & 40 deletions
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: "Lab: AI Fundamentals for Developers"
3+
linkTitle: "Lab: AI Fundamentals"
4+
description: |
5+
Learn the core concepts of AI development — models, prompt engineering, tool
6+
calling, and RAG — through hands-on exercises in a live environment.
7+
summary: |
8+
Hands-on lab: Learn the four core pillars of AI application development.
9+
Work with the Chat Completions API, prompt engineering, tool calling, and RAG
10+
through interactive exercises.
11+
keywords: AI, Docker, Model Runner, prompt engineering, RAG, tool calling, lab, labspace
12+
aliases:
13+
- /labs/docker-for-ai/ai-fundamentals/
14+
params:
15+
tags: [ai, labs]
16+
time: 45 minutes
17+
resource_links:
18+
- title: Docker Model Runner docs
19+
url: /ai/model-runner/
20+
- title: Labspace repository
21+
url: https://github.com/dockersamples/labspace-ai-fundamentals
22+
---
23+
24+
Get hands-on with the four core pillars of AI application development: models,
25+
prompt engineering, tool calling, and RAG. This lab runs entirely on your
26+
machine using Docker Model Runner — no API key or cloud account required.
27+
28+
## Launch the lab
29+
30+
{{< labspace-launch image="dockersamples/labspace-ai-fundamentals" model-download="true" >}}
31+
32+
## What you'll learn
33+
34+
By the end of this Labspace, you will have completed the following:
35+
36+
- Understand the Chat Completions API and how to structure messages for a model
37+
- Use prompt engineering techniques including system prompts, few-shot examples, and structured output
38+
- Implement tool calling and the agentic loop in code
39+
- Build a RAG pipeline that grounds model responses in your own data
40+
41+
## Modules
42+
43+
| # | Module | Description |
44+
| --- | ------------------------------------ | ----------------------------------------------------------------- |
45+
| 1 | Welcome & Setup | Introduction to the lab and verifying your environment |
46+
| 2 | Talking to Models | Chat Completions API, message roles, and stateless model behavior |
47+
| 3 | Prompt Engineering | System prompts, few-shot examples, and structured output |
48+
| 4 | Tool Calling | Tool definitions, the agentic loop, and executing tools in code |
49+
| 5 | Retrieval Augmented Generation (RAG) | Retrieve, augment, and generate with your own knowledge base |
50+
| 6 | Wrap-up | Summary of concepts and next steps |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Lab: Container Image Attestations"
3+
linkTitle: "Lab: Container Image Attestations"
4+
description: |
5+
Learn to attach SBOMs, build provenance, image signatures, and VEX
6+
statements to container images for a verifiable software supply chain.
7+
summary: |
8+
Hands-on lab: Add supply chain metadata to a container image. Generate
9+
SBOMs and SLSA provenance with BuildKit, sign images with Cosign, and
10+
attach OpenVEX statements to declare vulnerability exploitability status.
11+
keywords: Docker, supply chain, SBOM, provenance, SLSA, Cosign, VEX, attestations, security, lab, labspace
12+
params:
13+
tags: [labs]
14+
time: 45 minutes
15+
resource_links:
16+
- title: Build attestations
17+
url: /build/metadata/attestations/
18+
- title: SBOM attestations
19+
url: /build/metadata/attestations/sbom/
20+
- title: Provenance attestations
21+
url: /build/metadata/attestations/slsa-provenance/
22+
- title: Labspace repository
23+
url: https://github.com/dockersamples/labspace-attestation-basics
24+
---
25+
26+
Prove where your container images came from and that they haven't been
27+
tampered with. This lab walks through generating SBOMs and SLSA build
28+
provenance with BuildKit, signing images with Cosign, and writing VEX
29+
statements to declare which CVEs affect your image — the techniques used
30+
to meet supply chain security requirements like NIST SSDF and EO 14028.
31+
32+
## Launch the lab
33+
34+
{{< labspace-launch image="dockersamples/labspace-attestation-basics" >}}
35+
36+
## What you'll learn
37+
38+
By the end of this Labspace, you will have completed the following:
39+
40+
- Generate and inspect an SPDX SBOM attached to a container image with `--sbom=true`
41+
- Generate SLSA build provenance with `--provenance=mode=max` and understand how multi-stage builds are fully recorded
42+
- Install Cosign and use key-based signing to sign and verify a container image
43+
- Write an OpenVEX statement to declare CVE exploitability status and attach it as a signed attestation
44+
- Understand how SBOMs, provenance, signatures, and VEX complement each other in a complete supply chain story
45+
46+
## Modules
47+
48+
| # | Module | Description |
49+
| --- | --------------------------------- | ------------------------------------------------------------------------------------ |
50+
| 1 | Introduction | Overview of supply chain attestations and the sample Go app |
51+
| 2 | Software Bill of Materials (SBOM) | Build with `--sbom=true`, inspect SPDX contents, and understand scanner integration |
52+
| 3 | Build Provenance | Generate SLSA provenance and explore how multi-stage builds are recorded |
53+
| 4 | Signing Images with Cosign | Generate a key pair, sign the image, verify the signature, and learn keyless signing |
54+
| 5 | VEX Statements | Scan for CVEs, write an OpenVEX document, and attach it as a signed attestation |
55+
| 6 | Bringing It All Together | Run the complete build-sign-attest workflow and see the full supply chain picture |
56+
| 7 | Recap | Summary of skills and next steps for policy enforcement and higher SLSA levels |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Lab: Building Container Images"
3+
linkTitle: "Lab: Building Container Images"
4+
description: |
5+
Learn to build production-grade container images using Dockerfile best
6+
practices — layer caching, multi-stage builds, non-root users, base image
7+
selection, and secure build-time secret handling.
8+
summary: |
9+
Hands-on lab: Transform a basic Dockerfile into a production-ready image.
10+
Master layer caching, multi-stage builds, .dockerignore, non-root users,
11+
base image selection, and build secrets.
12+
keywords: Docker, Dockerfile, images, multi-stage builds, layer caching, build secrets, lab, labspace
13+
params:
14+
tags: [labs]
15+
time: 45 minutes
16+
resource_links:
17+
- title: Dockerfile reference
18+
url: /reference/dockerfile/
19+
- title: Multi-stage builds
20+
url: /build/building/multi-stage/
21+
- title: Build secrets
22+
url: /build/building/secrets/
23+
- title: Labspace repository
24+
url: https://github.com/dockersamples/labspace-building-images
25+
---
26+
27+
Take a working but naïve Dockerfile and progressively improve it into a
28+
production-grade image. Each section introduces one technique, applied to
29+
a real Python Flask app, so you can see the impact directly.
30+
31+
## Launch the lab
32+
33+
{{< labspace-launch image="dockersamples/labspace-building-images" >}}
34+
35+
## What you'll learn
36+
37+
By the end of this Labspace, you will have completed the following:
38+
39+
- Read an image's layer history and understand the layer cleanup pitfall
40+
- Restructure a Dockerfile for fast, cache-efficient incremental builds
41+
- Write a `.dockerignore` file and run containers as a non-root user
42+
- Use multi-stage builds to run tests as a build gate and dramatically reduce image size
43+
- Choose the right base image for production, including Docker Hardened Images
44+
- Inject secrets safely at build time using `--mount=type=secret`
45+
46+
## Modules
47+
48+
| # | Module | Description |
49+
| --- | -------------------------- | ---------------------------------------------------------------------- |
50+
| 1 | Welcome & Your First Build | Explore the sample app and build the initial image |
51+
| 2 | Understanding Image Layers | Inspect layers with `docker history` and see the layer cleanup pitfall |
52+
| 3 | Dockerfile Best Practices | Fix cache ordering, add `.dockerignore`, and switch to a non-root user |
53+
| 4 | Multi-Stage Builds | Run tests as a build gate and use a slim base for the production stage |
54+
| 5 | Choosing a Base Image | Compare slim, Alpine, and Docker Hardened Images |
55+
| 6 | Build Secrets | Show why `ARG` leaks secrets and use `--mount=type=secret` safely |
56+
| 7 | Wrap-up | Review the complete best-practices checklist and next steps |
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: "Lab: Docker Compose Quickstart"
3+
linkTitle: "Lab: Docker Compose Quickstart"
4+
description: |
5+
Build a multi-container Flask and Redis application from scratch using Docker
6+
Compose. Learn health checks, watch mode, named volumes, and multi-file
7+
configurations.
8+
summary: |
9+
Hands-on lab: Define and run a multi-container app with Docker Compose.
10+
Progress from a bare compose.yaml through health checks, live development
11+
with watch mode, data persistence, and modular Compose file composition.
12+
keywords: Docker, Compose, multi-container, Flask, Redis, watch mode, volumes, lab, labspace
13+
params:
14+
tags: [labs]
15+
time: 45 minutes
16+
resource_links:
17+
- title: Docker Compose docs
18+
url: /compose/
19+
- title: Compose watch mode
20+
url: /compose/how-tos/file-watch/
21+
- title: Labspace repository
22+
url: https://github.com/dockersamples/labspace-compose-quickstart
23+
---
24+
25+
Build a Python Flask and Redis hit-counter app using Docker Compose, starting
26+
from a bare `compose.yaml` and progressively adding production-quality
27+
features at each step.
28+
29+
## Launch the lab
30+
31+
{{< labspace-launch image="dockersamples/labspace-compose-quickstart" >}}
32+
33+
## What you'll learn
34+
35+
By the end of this Labspace, you will have completed the following:
36+
37+
- Define a multi-service application in a `compose.yaml` file and manage it with Compose commands
38+
- Control service startup order using health checks and `depends_on` conditions
39+
- Iterate on code without manual rebuilds using Compose watch mode
40+
- Persist data across container restarts with named volumes
41+
- Modularize a stack across multiple files using the `include` directive
42+
- Use `config`, `logs`, and `exec` to inspect and debug a running stack
43+
44+
## Modules
45+
46+
| # | Module | Description |
47+
| --- | -------------------------------- | --------------------------------------------------------------------- |
48+
| 1 | Introduction | Tour the starter app and verify the environment |
49+
| 2 | Defining Services | Write the first `compose.yaml` and bring up the Flask and Redis stack |
50+
| 3 | Health Checks & Startup Order | Add a Redis healthcheck and `depends_on` to eliminate race conditions |
51+
| 4 | Live Development with Watch Mode | Configure watch mode to sync code changes without manual rebuilds |
52+
| 5 | Persistence & Debugging | Add a named volume so Redis data survives `docker compose down` |
53+
| 6 | Using Multiple Compose Files | Extract Redis into `infra.yaml` and compose files with `include` |
54+
| 7 | Additional Commands | Use `config`, `logs -f`, and `exec` to inspect the running stack |
55+
| 8 | Recap | Review what was built and explore next steps |
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "Lab: Getting Started with Docker"
3+
linkTitle: "Lab: Getting Started with Docker"
4+
description: |
5+
Learn Docker fundamentals by running containers, exploring the container
6+
lifecycle, and packaging a real Node.js app into your own custom image.
7+
summary: |
8+
Hands-on lab: Run your first containers, write a Dockerfile, build a custom
9+
image from a Node.js app, and optionally push it to Docker Hub.
10+
keywords: Docker, containers, Dockerfile, images, getting started, lab, labspace
11+
params:
12+
tags: [labs]
13+
time: 30 minutes
14+
resource_links:
15+
- title: Docker overview
16+
url: /get-started/docker-overview/
17+
- title: Dockerfile reference
18+
url: /reference/dockerfile/
19+
- title: Labspace repository
20+
url: https://github.com/dockersamples/labspace-container-getting-started
21+
---
22+
23+
Start from zero and learn Docker's core building blocks. You'll run pre-built
24+
containers, write a `Dockerfile` to package a Node.js app, build your own
25+
image, and see container immutability and isolation in action.
26+
27+
## Launch the lab
28+
29+
{{< labspace-launch image="dockersamples/labspace-container-getting-started" >}}
30+
31+
## What you'll learn
32+
33+
By the end of this Labspace, you will have completed the following:
34+
35+
- Understand what containers are and how they differ from virtual machines
36+
- Run containers in the background, inspect their logs and filesystem, and manage their lifecycle
37+
- Write a `Dockerfile` to package an application, using layer caching for fast rebuilds
38+
- Build a custom image with `docker build` and run it as a container
39+
- Optionally publish your image to Docker Hub
40+
41+
## Modules
42+
43+
| # | Module | Description |
44+
| --- | ------------------------- | ------------------------------------------------------------------------------ |
45+
| 1 | Welcome to Docker | Introduction to containers and running your first `hello-world` container |
46+
| 2 | Running Containers | Launch nginx, inspect logs and internals, and manage the container lifecycle |
47+
| 3 | Building Your First Image | Write a `Dockerfile` and build a custom image from a Node.js app |
48+
| 4 | Running Your App | Run your image, explore container isolation, and optionally push to Docker Hub |
49+
| 5 | Wrap-up | Summary of key concepts and next steps |
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
title: "Lab: Container-Supported Development"
3+
linkTitle: "Lab: Container-Supported Development"
4+
description: |
5+
Learn to use containers for local development by running a PostgreSQL
6+
database, defining a Compose file, and adding a pgAdmin dev tool — no local
7+
installations required.
8+
summary: |
9+
Hands-on lab: Run dependent services in containers during local development.
10+
Start a PostgreSQL database, write a compose.yaml, and add a database
11+
visualizer — all without installing anything on the host.
12+
keywords: Docker, Compose, local development, PostgreSQL, pgAdmin, containers, lab, labspace
13+
params:
14+
tags: [labs]
15+
time: 30 minutes
16+
resource_links:
17+
- title: Docker Compose docs
18+
url: /compose/
19+
- title: Bind mounts
20+
url: /engine/storage/bind-mounts/
21+
- title: Labspace repository
22+
url: https://github.com/dockersamples/labspace-container-supported-development
23+
---
24+
25+
Use containers to run the services your app depends on — databases, caches,
26+
message queues — without installing anything locally. This lab walks through
27+
running PostgreSQL in a container, writing a `compose.yaml` your whole team
28+
can share, and adding a pgAdmin visualizer to the dev stack.
29+
30+
## Launch the lab
31+
32+
{{< labspace-launch image="dockersamples/labspace-container-supported-development" >}}
33+
34+
## What you'll learn
35+
36+
By the end of this Labspace, you will have completed the following:
37+
38+
- Run a PostgreSQL database in a container with no local installation
39+
- Use bind mounts to seed a database with schema and initial data at startup
40+
- Write a `compose.yaml` that codifies the entire dev stack for the team
41+
- Add a pgAdmin container to visualize and inspect the database
42+
- Understand how containerized dev stacks reduce onboarding time and environment drift
43+
44+
## Modules
45+
46+
| # | Module | Description |
47+
| --- | -------------------------------- | ----------------------------------------------------------------------------------- |
48+
| 1 | Introduction | Meet the Memes-R-Us app and understand the container-supported development approach |
49+
| 2 | Running a Containerized Database | Start PostgreSQL, connect the app, and seed the database using bind mounts |
50+
| 3 | Making Life Easier with Compose | Replace `docker run` commands with a shared `compose.yaml` |
51+
| 4 | Adding Dev Tools | Add pgAdmin to the Compose stack for database visualization |
52+
| 5 | Recap | Review key takeaways and explore related guides |
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: "Lab: The Containerized SDLC"
3+
linkTitle: "Lab: The Containerized SDLC"
4+
description: |
5+
Build a Node.js API and containerize every stage of the software development
6+
lifecycle — local development, integration testing, CI/CD, and Kubernetes
7+
deployment.
8+
summary: |
9+
Hands-on lab: Take a Node.js app from source to live Kubernetes deployment
10+
using Docker Compose, Testcontainers, Gitea Actions CI/CD, and kubectl —
11+
with containers at every stage of the SDLC.
12+
keywords: Docker, Compose, Testcontainers, Kubernetes, CI/CD, SDLC, lab, labspace
13+
params:
14+
tags: [labs]
15+
time: 60 minutes
16+
resource_links:
17+
- title: Docker Compose docs
18+
url: /compose/
19+
- title: Testcontainers docs
20+
url: https://testcontainers.com/
21+
- title: Labspace repository
22+
url: https://github.com/dockersamples/labspace-containerized-sdlc
23+
---
24+
25+
Build a real Node.js API, then apply containers at every stage of the software
26+
development lifecycle. You'll write a Compose file for local development,
27+
integration tests using Testcontainers, a CI/CD pipeline, and Kubernetes
28+
manifests — using the same container image throughout.
29+
30+
## Launch the lab
31+
32+
{{< labspace-launch image="dockersamples/labspace-containerized-sdlc" browserUrl="http://dockerlabs.xyz" >}}
33+
34+
## What you'll learn
35+
36+
By the end of this Labspace, you will have completed the following:
37+
38+
- Set up a containerized local development environment with Docker Compose and Compose Watch
39+
- Write integration tests that spin up a real database using Testcontainers
40+
- Build a CI/CD pipeline that tests, builds, and pushes a container image automatically
41+
- Write Kubernetes manifests and deploy a live application to a k3s cluster
42+
- Automate deployments so every push to `main` triggers a rollout
43+
44+
## Modules
45+
46+
| # | Module | Description |
47+
| --- | ----------------------------------------- | ------------------------------------------------------------------------ |
48+
| 1 | Introduction: Meet the App | Tour the TaskFlow API and understand the SDLC journey ahead |
49+
| 2 | Local Dev with Docker Compose | Write a `compose.yaml` to provision a local database and visualizer |
50+
| 3 | Containerizing Your Dev Environment | Add the app to Compose with hot-reloading via Compose Watch |
51+
| 4 | Integration Testing with Testcontainers | Write self-contained tests that start a real PostgreSQL container |
52+
| 5 | Continuous Integration with Gitea Actions | Build a pipeline that tests, builds, and pushes a container image |
53+
| 6 | Deploying to Kubernetes | Write manifests and deploy to a live k3s cluster with automated rollouts |
54+
| 7 | The Containerized SDLC: A Recap | Review the portability, consistency, and reproducibility gains |

0 commit comments

Comments
 (0)