Skip to the content ForoHackers
Log inJoin

Containers: start here

Containers
#3385 · · Quote · 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

You are not logged in, so this goes up anonymously: no account, no name and no address is stored with it, and it may carry no link and no image. Log in or join to post under your name. Our web server's logs keep the address and time of every request for up to 14 days; to keep yours out of them, use Tor. To reach the staff in confidence, use the drop. Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply