Day 1 of 5
⏱ ~60 minutes
Docker and Cloud for AI — Day 1

Docker Basics: Why Every AI Developer Needs Containers

If your AI app works on your laptop but fails in production, Docker is the fix. Day 1 explains why containers matter and gets you running your first container.

The Problem Docker Solves

"It works on my machine" is the most expensive phrase in software development. Different Python versions, missing packages, OS differences — all of these cause production failures. Docker packages your entire environment — code, dependencies, Python version, OS settings — into a single container that runs identically everywhere.

For AI apps specifically, this matters because:

Install Docker

Download Docker Desktop from docker.com. Verify installation:

Terminal
docker --version
docker run hello-world

Core Docker Concepts

Your First Container

Run Python in a Container
# Run Python 3.11 in a container
docker run -it python:3.11-slim python

# Inside the container:
>>> import sys
>>> print(sys.version)  # 3.11.x

# Exit with Ctrl+D
# The container stops when Python exits
Useful Docker Commands
docker ps           # List running containers
docker ps -a        # List all containers (including stopped)
docker images       # List local images
docker rm [id]      # Remove a container
docker rmi [image]  # Remove an image
docker logs [id]    # View container logs
docker exec -it [id] bash  # Shell into running container
Day 1 Exercise
Get Comfortable With Containers
  1. Install Docker Desktop and verify with docker --version.
  2. Run docker run hello-world. Read the output — it explains exactly what happened.
  3. Run docker run -it python:3.11-slim python and experiment in the Python shell.
  4. Run docker run -it node:20-alpine sh and explore a Node.js container.
  5. Practice the basic commands: ps, images, rm. Get comfortable with the CLI.

Day 1 Summary

  • Docker packages your app and its entire environment into a portable container.
  • Image = blueprint. Container = running instance. Dockerfile = instructions.
  • docker run, ps, images, rm, logs, exec — the commands you use every day.
Finished this lesson?