Chapter 1
2 min read
Introduction to Containers and Container Security
TL;DR
This chapter introduces the world of containers, Docker, Kubernetes, and container security:
This chapter introduces the world of containers, Docker, Kubernetes, and container security:
- Docker's Birth: Docker revolutionized Linux containers in 2013.
- Kubernetes Emergence: Google's Kubernetes, open-sourced in 2014, became the standard deployment platform for containers.
- Container Basics: Containers are isolated processes that use Linux namespaces and cgroups for isolation and resource management.
- Linux Namespaces: Different types of namespaces isolate processes, networks, mounts, hostnames, and IPC resources.
- Docker vs. VMs: Containers share the host's kernel, making them lightweight compared to virtual machines.
- Container Runtimes: Docker isn't the only runtime; others like containerd and CRI-O exist.
- Kubernetes Evolution: Note that as of Kubernetes 1.20 (released in late 2020), Docker is no longer supported as a runtime out-of-the-box. Kubernetes now uses runtimes like containerd or CRI-O, though you can still use Docker for building images.
- Installing Docker: Docker is the most popular development tool, and runs on Linux, macOS, and Windows.
- Running Containers: Start with simple commands like
docker run hello-worldand explore image tags and digests. - Introduction to Kubernetes: Kubernetes is complex but powerful.
- Installing Kubernetes: Explore local Kubernetes options like Docker Desktop, Minikube, or Kind.
- Kubernetes Building Blocks: Pods, services, deployments, namespaces, and ingress.
- Hello World with Kubernetes: Create and manage pods with
kubectl, explore logs and use Helm charts for package management. - Container Security: Learn the importance of software bill of materials (SBOMs) and vulnerability checking.
This chapter sets the stage for a deeper dive into container technology and security considerations.