Building Images in Docker

From the Docker cheat sheet · Image Management · verified Jul 2026

Building Images

Build Docker images from Dockerfiles with various options

bash
# Build image
docker build -t myapp .
docker build -t myapp:v1 .
docker build -f Dockerfile.dev -t myapp:dev .

# Build arguments
docker build --build-arg VERSION=1.0 -t myapp .

# Build options
docker build --no-cache -t myapp .
docker build --pull -t myapp .
💡 Use .dockerignore to exclude files
⚡ BuildKit provides advanced features
📌 Multi-stage builds reduce image size
✅ Always tag images with versions

More Docker tasks

Back to the full Docker cheat sheet