I'm looking for free ways to practice diagnosing Docker problems from logs, including an interview exercise that asks you to reconstruct a Dockerfile. I'd also like to practice Kubernetes and Terraform eventually. Where should I start?
How can I practice debugging Docker logs for interviews?
Answers
First, ask whether the exercise gives you build logs or application runtime logs. Those tell you different things. Build logs may show Dockerfile instructions and commands, while runtime logs generally tell you about the application inside the container, not how the image was built.
Even with build logs, you might be able to infer parts of a Dockerfile without recovering the exact original. In an interview, state what the logs support, what you're guessing, and what else you'd want to inspect.
Reply to this answer
Make your own mini lab with Docker or Podman. Build a small image, deliberately break one thing at a time, and save the build output. Try errors like a wrong base image reference or a command that fails during the build.
Then set the Dockerfile aside and see what you can infer from the output. Compare your proposed fix with the original file afterward. Do the same with runtime failures so you get used to separating build problems from application problems.
Reply to this answer
For the broader DevOps practice, add layers gradually. Build a custom image first, then try running it in a local Kubernetes cluster with kind or k3s. Write the manifests yourself, and later try Helm and Argo for deployments.
You don't need a big home lab to begin, and you can leave Terraform for a separate exercise rather than trying to learn every tool at once.
Reply to this answer
I'd also use the interview prompt as a chance to ask questions. Why is the Dockerfile missing? Is there a source repository or build history to check? Guessing packages from logs may be a useful puzzle, but it isn't a substitute for finding the actual build definition.
Reply to this answer
Add your answer
Answers are reviewed before publication.
_j57!socketruler.8:
A curated exercise might contain enough clues for a plausible reconstruction. That's different from assuming any set of logs can reveal the original file.