Skip to content

davidomara/devops-learning-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DevOps Learning Lab

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, and Dockerfile used 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.0

If you want an interactive shell into the image for debugging:

docker run --rm -it hello-app-hub:2.0 powershell

Notes / Dockerfile change

  • The app/Dockerfile originally used a multi-stage build that copied /root/.local from the builder stage into the final image. That copy failed when requirements.txt was empty because /root/.local did not exist in the builder layer.
  • I simplified the app/Dockerfile to a single-stage build that runs pip install -r requirements.txt directly in the image. This avoids errors when requirements.txt is 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:$PATH

Next steps

  • Add real dependencies to app/requirements.txt when needed.
  • Replace the simple print app with a small HTTP server if you want to demo port mapping.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors