Skip to content
 
 

Repository files navigation

📦 Python Hello World Docker Project

This guide will walk you through creating a simple Python Hello World app, containerizing it with Docker, and running it locally.


git clone https://github.com/atulkamble/pythonhelloworld.git
cd pythonhelloworld

📁 Project Structure

.
├── Dockerfile
└── helloworld.py

📜 Steps to Build and Run

1️⃣ Create Python Hello World Script

touch helloworld.py

Open and add the following code:

print("Hello, World")

Check the file:

cat helloworld.py

Run it locally to test:

python helloworld.py

2️⃣ Create Dockerfile

touch Dockerfile

Edit and add the following content:

FROM python:latest
WORKDIR /app
COPY helloworld.py .
CMD ["python", "helloworld.py"]

Check files:

ls

3️⃣ Build Docker Image

docker build -t docker.io/atuljkamble/pythonhelloworld .

Check Docker images:

docker images

4️⃣ Push Docker Image to Docker Hub

docker push docker.io/atuljkamble/pythonhelloworld

5️⃣ Pull Image (if testing from another system)

docker pull docker.io/atuljkamble/pythonhelloworld

6️⃣ Run Docker Container

docker run docker.io/atuljkamble/pythonhelloworld

Check running containers:

docker container ls
docker ps -a

✅ Output Example

Hello, World from Dockerized Python App!

📌 Notes

  • Make sure you are logged in to Docker Hub before pushing:

    docker login
  • Replace atuljkamble with your Docker Hub username if different.


👨‍💻 Author

Atul Kamble

About

Dockerize Python Hello World App | 15-07-2025

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages