A step-by-step guide to running the GenAI Foundry demos using Docker. No prior Docker experience needed.
Think of Docker as a shipping container for software. Just like a shipping container holds everything needed for delivery, a Docker container holds everything your app needs to run — Python, libraries, code — all in one neat package.
Why use it?
| Benefit | What it means |
|---|---|
| Consistent | Works the same on every computer |
| No conflicts | Won't interfere with your other Python projects |
| Easy cleanup | Remove everything with one command |
| One command | Build once, run anywhere |
Download Docker Desktop for your operating system:
| Operating System | Download Link |
|---|---|
| Windows | Docker Desktop for Windows |
| Mac (Intel) | Docker Desktop for Mac |
| Mac (Apple Silicon) | Docker Desktop for Mac |
| Linux | Docker Desktop for Linux |
After installation:
- Open Docker Desktop
- Wait for the whale icon to stop animating (this means it's ready)
- Verify by opening a terminal and typing:
docker --version
Option A: Clone with Git (recommended)
git clone https://github.com/dlwhyte/GenAI_foundry.git
cd GenAI_foundryOption B: Download ZIP
- Go to https://github.com/dlwhyte/GenAI_foundry
- Click the green "Code" button
- Click "Download ZIP"
- Extract the ZIP file
- Open a terminal and navigate to the folder
docker build -t genai-foundry .-t genai-foundrygives the image a name.tells Docker to look in the current folder for the Dockerfile
This will take 3-5 minutes the first time (downloading Python, ML libraries, etc.).
Wait until you see:
Successfully built xxxxxxxxxx
Successfully tagged genai-foundry:latest
Without an API key (RAG Explorer works without one):
docker run -p 8501:8501 genai-foundryWith an OpenAI API key (needed for Ontology demo + RAG Chat):
docker run -p 8501:8501 -e OPENAI_API_KEY=sk-your-key-here genai-foundryYou'll see:
You can now view your Streamlit app in your browser.
URL: http://0.0.0.0:8501
Open your browser and go to: http://localhost:8501
🎉 You should see the GenAI Foundry home page with all three demos!
Press Ctrl+C in the terminal to stop the container.
- Cause: Docker isn't installed or terminal was opened before installation
- Solution:
- Make sure Docker Desktop is installed
- Close and reopen your terminal
- On Windows, try restarting your computer
- Cause: Docker Desktop isn't running
- Solution:
- Open Docker Desktop application
- Wait for the whale icon to stop animating
- Try the command again
- Cause: Another app (or another container) is using that port
- Solution: Use a different port:
Then open
docker run -p 8502:8501 genai-foundry
http://localhost:8502instead
- Cause: You're not in the right directory
- Solution: Make sure you
cdinto the folder containing theDockerfile:cd path/to/GenAI_foundry ls # Should show Dockerfile, Home.py, etc.
- Cause: First-time download of Python, ML libraries, and models (~1GB+)
- Solution: This is normal for the first build. Subsequent builds are much faster due to caching.
- Cause: Browser cache
- Solution: Hard refresh with
Ctrl + Shift + R(Windows/Linux) orCmd + Shift + R(Mac)
# See running containers
docker ps
# See all containers (including stopped)
docker ps -a
# Stop a container
docker stop <container_id>
# Remove a container
docker rm <container_id>
# See all images
docker images
# Remove an image
docker rmi genai-foundry
# Rebuild without cache (if you need a fresh build)
docker build --no-cache -t genai-foundry .
# Run in background (detached mode)
docker run -d -p 8501:8501 genai-foundry
# View logs of a background container
docker logs <container_id>
# Stop all running containers
docker stop $(docker ps -q)If you want to free up disk space later:
# Remove the container (after stopping it)
docker rm $(docker ps -a -q --filter ancestor=genai-foundry)
# Remove the image
docker rmi genai-foundry
# Remove all unused Docker data (careful!)
docker system prune┌─────────────────────────────────────────────────────────┐
│ DOCKER QUICK START │
├─────────────────────────────────────────────────────────┤
│ 1. Open terminal │
│ 2. cd GenAI_foundry │
│ 3. docker build -t genai-foundry . │
│ 4. docker run -p 8501:8501 genai-foundry │
│ 5. Open http://localhost:8501 │
│ 6. Ctrl+C to stop │
│ │
│ With API key: │
│ docker run -p 8501:8501 -e OPENAI_API_KEY=sk-... \ │
│ genai-foundry │
└─────────────────────────────────────────────────────────┘
- Docker Documentation: https://docs.docker.com/get-started/
- Streamlit Documentation: https://docs.streamlit.io/
- Course Discussion Forum: Post your question with any error messages
MIT Professional Education: Applied Generative AI for Digital Transformation