Skip to the content ForoHackers
Log inJoin

Containers: start here

Containers
#879 · Ophuscado · · Report

A container is an ordinary process, or group of processes, that the kernel isolates so it sees its own files, network and process list. Unlike a virtual machine it shares the host's kernel, so it starts in moments and costs little. Containers package an application with its dependencies, which makes it run the same everywhere.

Key concepts

  • Namespaces: the kernel gives a process a private view of processes, mounts, network and users.
  • Control groups: limits and accounting for CPU, memory and I/O of a group of processes.
  • Images and layers: a read-only, layered file system that is the template for containers.
  • Registries: places where images are stored, versioned and pulled from.
  • Orchestration: systems that schedule many containers across machines, restart them and route traffic to them.

Vocabulary

  • Image and container: the packaged template, and a running instance of it.
  • Dockerfile: a recipe of steps that builds an image layer by layer.
  • Volume: storage kept outside a container so data outlives it.
  • Rootless: running containers without root privileges on the host.

What to study, in order

  1. Run a container, list its processes from inside and from the host, and compare.
  2. Write a Dockerfile for a small program; keep images small and builds repeatable.
  3. Use volumes and networks to connect a service to its database.
  4. Build a crude container by hand with namespaces and a changed root directory.
  5. Apply limits with control groups and watch a process get restricted.

Related tags

#linux #virtualization #devops #cloud #ci-cd

Log in or join to reply.