qtsone/learning / skills/tutor
tutor
FlaggedTurn this agent into a personal programming tutor with a versioned 0-to-expert curriculum (Go available; more languages coming). Use when the user wants to learn a programming language, start or resume lessons, get their exercise code graded, check learning progress, or contribute curriculum fixes — e.g. "/tutor go", "/tutor resume", "teach me Go", "continue my lessons", "grade my exercise".
curriculum/content/focus/containers/dockerizing-go/solution/NOTES.md
View on GitHub# Notes — Dockerizing timesvc
Answer each question on the `A:` line below it, in your own words, in at
least a couple of sentences. `check.sh` checks that you answered; your tutor
reads what you actually wrote.
## Q1. Sizes
What does `Dockerfile.naive` produce, and what does your `Dockerfile`
produce? Give both numbers (`docker image ls timesvc`) and say where the
difference went — what exactly is in the big one that is not in the small
one? No Docker installed? Then estimate both from the lesson and name the
three heaviest things the naive image carries.
A: The naive image is about 900 MB and mine is about 10 MB, roughly ninety times smaller. The naive one carries three things mine does not: the Go compiler and linker, the whole standard library source tree that ships with the toolchain, and a complete Debian userland (shell, apt, coreutils, package metadata). None of that is needed at runtime, because the compiler already turned the parts of the stdlib I use into the binary — about 9 MB of it. My final image is the distroless static base plus that one file.
## Q2. Base image
Which final base did you pick (scratch, distroless, alpine), and what did
you give up by picking it? Name one concrete thing you can no longer do
inside that container, and one thing you had to add to the Dockerfile
because the base does not provide it.
A: I picked gcr.io/distroless/static:nonroot, which is scratch plus the three things scratch users always end up re-adding: a CA bundle, tzdata, and an /etc/passwd entry. What I gave up is a shell — `docker exec -it … sh` fails, so I debug from logs, from `docker cp`, or by temporarily rebuilding on the :debug variant. What I had to add myself is the binary's absolute path in an exec-form ENTRYPOINT, because there is no shell to resolve PATH, plus an explicit numeric USER so the image also behaves under a runtime that enforces runAsNonRoot.
## Q3. CGO
Suppose you drop `CGO_ENABLED=0` and rebuild on the same builder image, then
copy the binary into your chosen final base. What breaks, at what moment
(build time or container start), and what would the error look like? Why?
A: The build still succeeds — golang:1.22-bookworm has gcc and glibc, so cgo links the net and os/user packages dynamically against Debian's glibc. It breaks at container start: the kernel reads the ELF interpreter path (/lib64/ld-linux-x86-64.so.2) recorded in the binary, cannot find that file in the distroless static image, and reports "exec /usr/local/bin/timesvc: no such file or directory" about a file that plainly exists. The missing file is the loader, not my binary. On alpine the same build fails the same way for a second reason: alpine ships musl, not glibc, so even the loader path is different.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |