Docker & Docker Compose
Production container lifecycle, multi-stage builds, Docker Compose orchestration, volume management, and system pruning.
Docker & Docker Compose Interactive Command Directory
Browse, search, and copy battle-tested commands & syntax recipes (19 Total Commands).
Run container in background detached mode with port forwarding and restart policy.
List all running and stopped containers in a clean formatted table.
Open an interactive terminal shell session inside a running container.
Stream live container output logs starting with the last 100 lines.
Build an optimized container image from a local Dockerfile with a version tag.
Build, recreate, and start all microservices defined in docker-compose.yml in background.
Stop and remove all containers, networks, and named persistent storage volumes.
Create and list managed persistent storage volumes detached from container lifecycle.
Create an isolated user-defined bridge network for internal DNS resolution.
Display a snapshot of CPU, memory, network I/O, and disk usage across running containers.
Copy configuration files or assets between a container and the local host filesystem.
Reclaim disk space by purging all stopped containers, dangling images, and unused volumes.
Compile multi-architecture container images supporting both x86_64 servers and Apple Silicon / ARM64 AWS Graviton nodes.
Print real-time CPU, RAM, and network I/O consumption across all running containers in clean tabular format.
Copy files or directories between a running container and the local host filesystem without SSH access.
Display all active running processes inside a specific container along with host PIDs.
Extract the internal bridge IP address assigned to a running container.
Create a compressed tarball backup of a named Docker persistent volume using an ephemeral helper container.
Horizontally scale the background worker service to 4 parallel container replicas in Docker Compose.
Companion Developer Tools & Playgrounds
Accelerate command execution and syntax debugging with HelloAIHub suite of interactive tools.
In-Browser Code Runner
Test and benchmark syntax scripts in Node.js, Python, TypeScript, and Go with zero local setup.
Regex Live Tester & Explainer
Debug regular expressions, lookarounds, capture groups, and substitution patterns with live AST explanations.
Dockerfile Generator
Generate multi-stage, rootless, production-hardened Dockerfiles with caching and alpine bases.
System Design Sizing Calculator
Compute real-time QPS, storage bandwidth, cache memory ratios, and replica math for distributed architectures.
Docker & Docker Compose: Command Groups & Quick Index
19 indexed entries across 17 sectionsHighlighted Flags & Syntax Examples in Docker & Docker Compose
Run container in background detached mode with port forwarding and restart policy.
List all running and stopped containers in a clean formatted table.
Open an interactive terminal shell session inside a running container.
Stream live container output logs starting with the last 100 lines.
Frequently Asked Questions
Expert recommendations, common traps, and production best practices for Docker & Docker Compose.
What is the difference between ADD and COPY in a Dockerfile?
COPY is preferred for local files and directories as it performs straightforward file copying. ADD can automatically extract tar archives and fetch files from remote URLs, which can introduce unpredictable build cache behavior.
How do multi-stage builds reduce container image size?
Multi-stage builds allow you to use heavy SDK images for compiling binaries and then copy only the compiled executable into a minimal runtime base (such as distroless or alpine), stripping compilers, caches, and devDependencies.
What is the difference between ENTRYPOINT and CMD?
ENTRYPOINT specifies the immutable executable run when the container starts. CMD provides default arguments to the ENTRYPOINT which can be easily overridden by passing CLI arguments to docker run.
What is the difference between Docker CMD and ENTRYPOINT in Dockerfiles?
ENTRYPOINT specifies the immutable binary or executable that runs when the container starts (e.g. ENTRYPOINT ["nginx"]). CMD provides default arguments to that executable (CMD ["-g", "daemon off;"]). Arguments passed to docker run override CMD completely, but are appended to ENTRYPOINT.
Why should production containers never run as root?
By default, container root (UID 0) maps directly to host root (UID 0). A container breakout vulnerability (such as CVE-2024-21626 in runc) gives an attacker full root control over the host operating system. Always create an unprivileged user (USER node or USER appuser) in your Dockerfile.
How does Docker layer caching work and how can I optimize it?
Docker executes instructions from top to bottom. If an instruction (like COPY package.json) has not changed, Docker reuses the cached layer. Placing static dependencies (COPY package*.json && npm ci) BEFORE dynamic source code (COPY . .) ensures Docker skips npm installs when only source files change, cutting build times from minutes to seconds.
Cross-Hub Skill Acceleration
Combine command lookups with active coding interviews and complete career paths.
Need More Cheat Sheets?
Explore developer cheat sheets and syntax guides on HelloAIHub.