How to Create a simple Python “Hello World” project - Dockerize it -Push it to GitHub using VS Code.
- Sharon Rajendra Manmothe

- 8 hours ago
- 1 min read
Step 1 — Create project folder in VS Code
Open VS Code
Go to File → Open Folder
Create/open a folder named:hello-docker-python
Step 2 — Create files
Inside VS Code, create these files:
📄 1. hello.py
print("Hello from Dockerized Python!")
📄 2. Dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY hello.py .
CMD ["python", "hello.py"]
📄 3. .dockerignore
__pycache__
*.pyc
.git
📄 4. README.md
Simple Python Docker demo.
Run:
docker build -t hello-python .
docker run --rm hello-python
Step 3 — Test Docker locally (optional but recommended)
Open VS Code terminal:Ctrl + `
Run:
docker build -t hello-python .
Then run:
docker run --rm hello-python
Expected output:
Hello from Dockerized Python!
If you see this, Docker is correct.
Step 4 — Upload project to GitHub from VS Code
A) Create empty GitHub repo
Go to GitHub → New Repository
Name: hello-docker-python
Do NOT add README
Copy your repository HTTPS URL, example:
B) Push your project from VS Code
In the VS Code terminal, run these commands:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/yourname/hello-docker-python.git
git push -u origin main
(Replace the URL with your own)
DONE!
You will now see all your files on GitHub:

$50
Product Title
Product Details goes here with the simple product description and more information can be seen by clicking the see more button. Product Details goes here with the simple product description and more information can be seen by clicking the see more button

$50
Product Title
Product Details goes here with the simple product description and more information can be seen by clicking the see more button. Product Details goes here with the simple product description and more information can be seen by clicking the see more button.

$50
Product Title
Product Details goes here with the simple product description and more information can be seen by clicking the see more button. Product Details goes here with the simple product description and more information can be seen by clicking the see more button.

Comments