Docker

This is my set of personal notes on the Docker paradigm, collected while completing the Katacode Docker Courses. Although I've restructured and restated the information to my preferences, some information is directly duplicated. Please check out the Katacode courses, they're an excellent entrypoint into the ecosystem.

Table of Contents

  1. Docker Overview
  2. Building Images
  3. Stateful Data Containers
  4. Container Networking
  5. Docker Compose
  6. Docker Clusters

Quick Reference

# Build the image defined in the current directory
docker build -t <name> .

# Run a container
docker run <name>
docker run -d <name>  # as a "detatched" background process
docker run -it <name> # as an "interactive terminal" foreground process
docker run -e NODE_ENV=production # set the NODE_ENV environment variable

# Start services defined in docker-compose.yml
docker-compose up

# List all running containers
docker ps
docker ps -q    # quiet, only show the container id's

# Get more details about a container
docker inspect <name|id>

# Display messages the container has written to stderr or stdout
docker logs <name|id>

# Find existing images on the Docker registry
docker search <image>