App Development lifecycle
Continuous integration (CI)
Continuous Delivery (CD)
Packaging and Docker
Docker setup
Building an API server
Deployments
Intro to Cloud
Using local LLMs
Appendix 1 yaml syntax
Appendix 2 Docker commands
Practice
Assignment
Core program
YAML Syntax Reference
Running Containers
| Command |
What it does |
docker run <image> |
Download (if needed) and run a container |
docker run -d <image> |
Run in the background (detached mode) |
docker run -p 3000:80 <image> |
Map port 80 in the container to port 3000 on your machine |
docker run -it <image> |
Run with interactive terminal (for CLI tools) |
docker run --name myapp <image> |
Give the container a custom name |
docker run --rm <image> |
Automatically remove the container when it stops |
Managing Containers
| Command |
What it does |
docker ps |
List running containers |
docker ps -a |
List all containers (including stopped) |
docker stop <id or name> |
Stop a running container |
docker start <id or name> |
Start a stopped container |
docker rm <id or name> |
Remove a stopped container |
docker logs <id or name> |
View container output / logs |
docker exec -it <id> bash |
Open a terminal inside a running container |
Images
| Command |
What it does |
docker pull <image> |
Download an image from Docker Hub |
docker images |
List downloaded images |
docker rmi <image> |
Remove an image |
docker build -t myapp . |
Build an image from a Dockerfile in the current directory |
Cleanup
| Command |
What it does |
docker stop $(docker ps -q) |
Stop all running containers |
docker system prune |
Remove all stopped containers, unused images, and cache |
Quick Reference: Flags
| Flag |
Short for |
Example |
-d |
detached |
Run in background |
-p |
port |
-p host:container |
-it |
interactive + tty |
Opens a terminal |
-v |
volume |
-v ./local:/container mount a folder |
--name |
— |
Give container a name |
--rm |
— |
Auto-remove when stopped |
-t |
tag |
Name your image during build |
Typical Workflow
docker pull nginx # 1. Download an image
docker run -dp 8080:80 nginx # 2. Run it
docker ps # 3. Check it's running
# visit localhost:8080
docker stop <id> # 4. Stop when done
docker rm <id> # 5. Clean up
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0
*https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.