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:

