Basic docker commands
# Create a directory structure
mkdir inventory_app
cd inventory_app
# Create app.py, requirements.txt, and Dockerfile
touch app.py requirements.txt Dockerfile
# Build the Docker image using the standard Python 3.11 image
docker build -t inventory-app:full .
# Display Docker images
docker images
# Rewrite the Dockerfile to use the lightweight Python 3.11-slim image
# (Edit Dockerfile content accordingly)
# Build the Docker image using the slim image
docker build -t inventory-app:slim .
# Display Docker images again
docker images
https://www.kdnuggets.com/how-to-create-minimal-docker-images-for-python-applications