- Create a Dockerfile for a Python application that runs a simple script (app.py) that prints "Hello, DevOps Intern!"
- Build and run the Docker image locally.
- Share the steps to build, run, and stop the container.
- Create a
Dockerfile
as shown in Dockerfile; - Create a Python script
app.py
as shown in app.py; - Build the Docker image:
docker build -t python-app .
- Run the container:
docker run --name python-container python-app
note: Using python:3.9-slim in the Dockerfile, the container automatically stops after script execution.