A learning repository for practicing modern DevOps tools and simple containerized apps.
Prerequisites:
- Docker installed and running on your machine.
Project Layout:
app/: small Python app,requirements.txt, andDockerfileused in examples.
Build the image
Open a PowerShell terminal, change into the app folder and build the image:
cd .\app
docker build -t hello-app-hub:2.0 .Run the container Run the built image (the app prints a message and exits):
docker run --rm hello-app-hub:2.0If you want an interactive shell into the image for debugging:
docker run --rm -it hello-app-hub:2.0 powershellNotes / Dockerfile change
- The
app/Dockerfileoriginally used a multi-stage build that copied/root/.localfrom the builder stage into the final image. That copy failed whenrequirements.txtwas empty because/root/.localdid not exist in the builder layer. - I simplified the
app/Dockerfileto a single-stage build that runspip install -r requirements.txtdirectly in the image. This avoids errors whenrequirements.txtis empty and keeps the build straightforward for this learning lab.
If you prefer a multi-stage approach and still want to install to the user site, ensure the builder creates the directory before copying (or install at least one package), for example:
# in builder stage
RUN pip install --user -r requirements.txt || true
RUN mkdir -p /root/.local
# then in final stage
COPY --from=builder /root/.local /root/.local
ENV PATH=/root/.local/bin:$PATHNext steps
- Add real dependencies to
app/requirements.txtwhen needed. - Replace the simple
printapp with a small HTTP server if you want to demo port mapping.