Docker Command Quest

Back to Dashboard

Docker Workflow Visualization

Visual representations of Docker architecture, container lifecycle, command flow, and Docker Compose workflow. These diagrams will help you understand how Docker components interact with each other.

Docker Architecture

┌─────────────────────────────────────────────────────────┐
│                     Docker Host                         │
│                                                         │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │
│  │ Container 1 │  │ Container 2 │  │ Container 3 │     │
│  │             │  │             │  │             │     │
│  │ App A       │  │ App B       │  │ App C       │     │
│  └─────────────┘  └─────────────┘  └─────────────┘     │
│         │               │               │               │
│         └───────────────┼───────────────┘               │
│                         │                               │
│                  ┌──────────────┐                       │
│                  │ Docker Engine│                       │
│                  └──────────────┘                       │
│                         │                               │
└─────────────────────────┼───────────────────────────────┘
                         │
                 ┌───────────────┐
                 │ Docker Client │
                 └───────────────┘

Docker Client: The command-line interface that allows users to interact with Docker.

Docker Host: The machine where Docker Engine runs.

Docker Engine: The core of Docker that creates and manages containers.

Containers: Isolated environments that run applications.

Container Lifecycle

┌─────────┐     ┌─────────┐     ┌─────────┐
│ Created │────▶│ Running │────▶│ Stopped │
└─────────┘     └─────────┘     └─────────┘
    │                               │
    │                               │
    │                               ▼
    │                          ┌─────────┐
    └─────────────────────────▶│ Removed │
                               └─────────┘

Commands:
- Create: docker create
- Start:  docker start, docker run
- Stop:   docker stop, docker pause
- Remove: docker rm

Created: Container is created but not started.

Running: Container is running with all processes active.

Stopped: Container is stopped but still exists.

Removed: Container is deleted and no longer exists.

Docker Command Flow

┌───────────────┐     ┌───────────────┐     ┌───────────────┐
│ docker build  │────▶│  docker push  │────▶│  docker pull  │
│ Create image  │     │ Share image   │     │ Download image│
└───────────────┘     └───────────────┘     └───────────────┘
                                                   │
                                                   ▼
┌───────────────┐     ┌───────────────┐     ┌───────────────┐
│  docker rm    │◀────│  docker stop  │◀────│  docker run   │
│ Remove        │     │ Stop container│     │ Create & start│
└───────────────┘     └───────────────┘     └───────────────┘

docker build: Creates a Docker image from a Dockerfile.

docker push: Uploads an image to a registry (like Docker Hub).

docker pull: Downloads an image from a registry.

docker run: Creates and starts a container from an image.

docker stop: Stops a running container.

docker rm: Removes a stopped container.

Docker Compose Workflow

┌─────────────────────┐
│ docker-compose.yml  │
└─────────────────────┘
          │
          ▼
┌─────────────────────┐     ┌─────────────────────┐
│ docker-compose up   │────▶│ docker-compose down │
│ Create & start all  │     │ Stop & remove all   │
└─────────────────────┘     └─────────────────────┘
          │
          ▼
┌─────────────────────┐
│ docker-compose logs │
│ View container logs │
└─────────────────────┘

docker-compose.yml: Configuration file that defines services, networks, and volumes.

docker-compose up: Creates and starts all services defined in the compose file.

docker-compose down: Stops and removes all resources created by docker-compose up.

docker-compose logs: Views output from containers.