feat(L08): add Docker fundamentals card

This commit is contained in:
user
2026-07-21 18:20:10 +02:00
commit 2ed1b7954a
39 changed files with 7419 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
root="${CARD_ROOT:?CARD_ROOT required}"; work="$(mktemp -d)"; trap 'rm -rf -- "$work"' EXIT
mkdir "$work/context"; printf 'hello from image\n' >"$work/context/hello.txt"
printf 'FROM scratch\nLABEL lesson="console"\nCOPY hello.txt /hello.txt\nCMD ["cat", "/hello.txt"]\n' >"$work/context/Dockerfile"
result="$(python3 "$root/src/fixtures/container_lab.py" "$work/state.json" build lesson:v1 "$work/context")"
digest="${result%% *}"; [[ "$digest" =~ ^sha256:[0-9a-f]{64}$ && "$result" == *'instructions=4' ]]
python3 "$root/src/fixtures/container_lab.py" "$work/state.json" image-inspect lesson:v1 | grep -q '"CMD"'
printf 'PASS task01 syntax=valid instructions=4 digest=%s engine=offline-model socket_exposed=0\n' "$digest"