Most people learning DevOps lose their first hour of every practice session to the same chores: creating a repository, adding a sample app, writing a container file, wiring up a pipeline. By the time the interesting part begins, motivation is already thinner. A better habit is to build one reusable lab template and clone it each time you want to try something new. This tutorial walks through creating that template step by step, using small pieces you can assemble in an evening.
Step 1: pick a tiny application
The sample app is only a vehicle, so keep it trivial. A small web service that answers a request with a short message and exposes a health check is plenty. Choose a language you already know. The goal is not to impress anyone with the app; it is to have something real enough to build, test, package and run.
Include one passing test. It might check that the health endpoint returns a success status. A single reliable test teaches the pipeline what “green” looks like.
Step 2: define the folder layout
Decide where everything lives and stick to it. A simple arrangement works well for learners:
- app for the service code and its test
- container for the build instructions
- pipeline for automation definitions
- infra for any environment description you write later
- docs for your own notes
Because the layout never changes between labs, you stop thinking about it, and your hands learn the paths.
Step 3: write the container build file
Add a short file that packages the app into an image. Keep it readable, with a comment above each instruction saying what it does. Those comments help future you remember why each line exists, and they are good practice for team settings too.
Test it locally: build the image, run it, and confirm the health check answers. If this works in the template, it will work in every clone.
Step 4: add a basic pipeline
Create a pipeline definition with three stages: run the test, build the image, and report the result. Make sure a failing test stops everything. To verify, break the test temporarily, push, and watch the pipeline go red. Then fix it and watch it go green. That one experiment teaches more than a page of theory.
Step 5: write a readme that earns its keep
Your readme should answer four things in plain words: what the lab is, how to run it, how to run the tests and where to add your own experiment. Add a short checklist at the bottom for what to do after cloning: rename the project, update the sample message, confirm the pipeline runs.
Step 6: mark the places to change
Search the template for anything specific, such as a project name, and replace it with an obvious placeholder, for instance YOUR-PROJECT-NAME. When you clone, a quick search for that marker finds everything that needs updating. This tiny trick prevents the awkward moment of discovering an old name in a build log.
Step 7: turn the repository into a template
Most hosting platforms let you flag a repository as a template, so a new project can be created from it with a single action and without any of the old history. If yours does not, keep a tagged release and clone from that. Either way, the aim is the same: each lab starts clean.
Step 8: use it, then improve it
Run your first real lab from the template. You might add a database, try a different deployment target or experiment with monitoring. After you finish, return to the template and ask what slowed you down. Perhaps the readme was unclear, or the pipeline lacked a lint step you added every time. Fold that improvement into the master. Each lab then leaves the template slightly better than before.
Where the template fits in your learning path
A lab template is a tool for practice, and practice works best with a purpose. If you are assembling evidence of your skills, a how-to on putting together a first DevOps portfolio sits comfortably beside this approach, since a consistent template makes a portfolio look coherent. And for ideas about what to build in each lab, this set of beginner-friendly hands-on DevOps project walkthroughs provides plenty of material.
An example from another field
Learners everywhere benefit from ready-made structure. Consider QuantumUting, a website about quantum computing organised into algorithm, circuit, tool and course sections. The structure lets a visitor jump straight to the part they want, just as your template lets you jump straight to the experiment.
Common mistakes
- Making the sample app too ambitious. If it takes hours to understand, it defeats the purpose.
- Letting secrets slip in. Never place real credentials in a template; use placeholders and keep actual values outside the repository.
- Cloning from an old copy instead of the master. Always start from the current template.
- Never updating it. The template should evolve with every lab.
- Adding too much. If a part is used in fewer than half your labs, leave it out and add it when needed.
A weekly rhythm
Many learners find it helpful to schedule a short session for template upkeep. Fifteen minutes on a weekend is enough: update dependencies, rebuild to confirm everything still passes, and add any improvements you noted during the week. A template that still builds today is one you can trust when motivation strikes at an odd hour.
What you will have in the end
After these eight steps you will own something small but valuable: a lab you can start in a minute instead of an hour. More importantly, you will have practised the thing DevOps teams do every day, which is turning a repeated task into a dependable starting point and then refining it over time. That habit outlasts any individual project you build with it.

