Docker Overview - snir1551/DevOps-Linux GitHub Wiki

Docker Overview

Docker is a platform for:

Docker is an open platform for developing, shipping, and running applications in containers.
Containers allow developers to package applications with all dependencies, enabling consistent behavior across environments.

Docker is useful for:

  • Fast delivery and automation – Ideal for CI/CD pipelines: from development to production, everything runs in the same container.

  • Portability and flexibility – Containers run consistently across environments (dev, staging, production, cloud, on-prem).

  • Efficient use of resources – Containers are lightweight and can run more workloads on the same hardware compared to virtual machines.

Docker Architecture

Docker follows a client-server model:

  • Docker Daemon (dockerd) – Listens to API requests and manages objects like containers, images, volumes, and networks.

  • Docker Client (docker) – The main user interface, which communicates with the daemon via CLI commands like docker run, docker build, etc.

  • Docker clients can connect to remote Docker daemons over a network using a REST API.

Docker Desktop Components

Available for Windows, macOS, and Linux. It includes:

  • Docker CLI

  • Docker daemon

  • Docker Compose

  • Docker Content Trust

  • Kubernetes (optional)

  • Credential helper

Docker Registries

A registry stores Docker images.

  • Docker Hub is the default public registry.

  • You can also set up a private registry.

  • Images are uploaded and downloaded using docker push and docker pull.

Core Docker Objects

Images – Read-only templates with instructions to create containers. Built from Dockerfile, each command creates a layer.

Containers – Runnable instances of images. Created with docker run. They include:

  • Writable layer on top of the image
  • Networking and process isolation
  • Destroyed or persisted depending on configuration

Underlying Technologies

Docker uses Linux kernel features:

  • Namespaces – For isolation (processes, networking, filesystems)

  • Control Groups (cgroups) – For resource limits (CPU, memory, etc.)

  • On Windows/Mac, Docker runs in a lightweight VM to simulate Linux kernel behavior.

What Happens During docker run ubuntu /bin/bash

  • Docker pulls the ubuntu image if it's not local.

  • A new container is created from the image.

  • A writable layer is added.

  • The container gets a unique network ID and virtual filesystem.

  • The command /bin/bash runs inside the container.

  • When you exit, the container stops, but its data may persist depending on setup.

⚠️ **GitHub.com Fallback** ⚠️