OnCallReadyStart learning

Docker Runtime & Networking: glossary

61 terms, in plain words, with where each one is taught.

--cap-drop (--cap-drop ALL, --cap-add)
docker run flags that remove capabilities from a container (--cap-drop ALL) and add specific ones back (--cap-add NET_BIND_SERVICE). Lesson 13.29
--cpus
A docker run flag that caps CPU time: --cpus 0.5 means at most half of one core. Over the cap the process is slowed (throttled), not killed. Lesson 13.1
--memory (-m, --memory-swap)
A docker run flag that caps the container's memory (--memory 256m). Docker writes it to the container's cgroup memory.max, so going over it gets the OOM killer, exit 137. Lesson 13.10
--mount type=bind
The long form of a bind mount: --mount type=bind,source=/srv/x,target=/x. Unlike -v, it refuses a host path that does not exist instead of creating it as root. Lesson 13.22
--pids-limit
A docker run flag that caps how many processes and threads the container may have. Past it, fork fails with EAGAIN ("Resource temporarily unavailable"). Lesson 13.10
--read-only (read-only root filesystem)
Mounts a container's own filesystem read-only, so nothing can be changed or dropped there. Writable paths are then given as tmpfs or volumes. Lesson 13.22
--user (-u)
A docker run flag that picks the UID (and optionally GID) the container's process runs as, overriding the image's USER: --user 1000:1000. Lesson 13.29
-XshowSettings:vm (-XshowSettings)
A java flag that prints the heap size the JVM picked. java -XshowSettings:vm -version prints it and exits, so you can check a limit before starting the real app. Lesson 13.10
anonymous volume (anonymous volumes)
A volume Docker creates with no name (a 64-hex ID) when an image declares VOLUME and you mount nothing there. docker rm leaves it behind; docker rm -v removes it. Lesson 13.22
bridge network (Linux bridge)
A virtual network switch inside the kernel. Docker plugs each container into one; containers on it get addresses from its subnet, and the host routes and NATs their traffic out. Lesson 13.15
CapEff (CapBnd, CapPrm)
The "effective capabilities" line in /proc/PID/status: a hex bitmask of the root powers a process can use right now. All zeros means none. Lesson 13.29
capsh (capsh --decode)
A tool (package libcap2-bin) that turns a capability bitmask into names: capsh --decode=00000000a80425fb. Lesson 13.29
chroot
Make a directory the root (/) for a process. From a privileged container, chroot into the host's mounted disk gives a shell on the host. Lesson 13.29
Compose profile (profiles:)
A label on a compose service that keeps it out of a normal up until you ask for it: docker compose --profile debug up -d. Lesson 13.31
Compose project (COMPOSE_PROJECT_NAME)
Everything one compose file creates, named after the directory by default: network orders_default, volume orders_pgdata, containers orders-db-1... Lesson 13.31
Compose service
One entry under services: in compose.yaml: one kind of container (image or build, env, ports, volumes...). Its name is also its DNS name on the project network. Lesson 13.31
compose.yaml (compose file, docker-compose.yml)
The YAML file Docker Compose reads: one entry per service with what you would pass to docker run, plus the volumes and networks they share.
container state (container states)
Where a container is in its life: created (never started), running, restarting (a restart policy is bringing it back) or exited (its PID 1 ended; the exit code and logs are kept). The STATUS column of docker ps -a shows it: Created, Up 2 hours, Restarting (1), Exited (137). Lesson 13.1
cpu.max
The cgroup file holding a CPU limit as "quota period" in microseconds: 150000 100000 means 150ms of CPU per 100ms, which is --cpus 1.5. max means no limit. Lesson 13.10
crash-consistent
A copy taken while a program was writing, like a disk after a power cut: files may be caught half-written. For a live database, use its dump tool instead. Lesson 13.22
dangling image (dangling images, <none>:<none>)
An image that no tag points to any more, usually the old version left behind after a rebuild. It shows as <none>:<none>. Lesson 13.26
data-root
The daemon.json setting for where Docker keeps everything (default /var/lib/docker). Putting it on its own filesystem stops Docker from filling the host's root disk.
default bridge (docker0)
The network a container joins when you give no --network: bridge, on host interface docker0 (172.17.0.1). It has no DNS, so containers on it cannot find each other by name. Lesson 13.5
depends_on
A compose setting for start order. Alone it only means "start that container first"; with condition: service_healthy Compose waits until the dependency's healthcheck passes. Lesson 13.31
detached mode (detached container)
Running a container in the background: docker run -d starts it, prints its ID and gives you your prompt back instead of showing its output. Lesson 13.1
docker compose config
Prints the compose file after interpolation, exactly as Compose will use it. The fastest check for missing variables and typos. Lesson 13.31
docker compose down (docker compose down -v)
Stops and deletes the project's containers and network. Named volumes are kept unless you add -v, which deletes the data too. Lesson 13.22
docker compose ps (docker compose logs)
ps lists the project's containers with state and health; logs SERVICE shows one service's output (-f to follow), like docker logs per service. Lesson 13.31
docker compose up (docker compose up -d)
Reads compose.yaml, creates the networks and volumes, then creates and starts every service. -d runs them in the background. Lesson 13.31
docker kill
Sends a signal to the container's PID 1 right away: SIGKILL by default, or another one with -s (docker kill -s HUP web). No grace period. Lesson 13.1
docker network (docker network ls, docker network inspect, docker network connect)
The commands for Docker networks: ls lists them, inspect NAME shows the subnet and which containers are attached, connect NET CONTAINER attaches a running container to one more network. Lesson 13.15
docker port
Shows a container's published ports: container port -> host address:port, e.g. 80/tcp -> 0.0.0.0:8080. Lesson 13.15
docker restart
A docker stop followed by a docker start: SIGTERM, the grace period, SIGKILL if needed, then the same container starts again with its writable layer kept. Lesson 13.7
docker stats
A live top for containers: CPU (percent of one core), memory used against the limit, network and disk I/O, and number of processes. --no-stream prints one snapshot. Lesson 13.5
docker update
Changes a running container's limits (memory, CPU) on the spot by rewriting its cgroup files. The next recreate goes back to what the run command says. Lesson 13.10
docker volume (docker volume ls, docker volume create, docker volume inspect)
The commands that list, create, inspect and delete named volumes. inspect shows the Mountpoint, the host directory under /var/lib/docker/volumes/. Lesson 13.22
EAGAIN
The error "resource temporarily unavailable". A program gets it, for example, when it tries to start a process or thread past the container's pids limit. Lesson 13.10
embedded DNS (127.0.0.11)
The DNS server Docker answers at 127.0.0.11 inside containers on user-defined networks. It resolves container names and aliases, and passes other names to the host's DNS. Lesson 13.15
env_file
A compose setting that loads a file of KEY=value lines into a container's environment. Different from .env, which only fills ${VAR} in the compose file. Lesson 13.31
host network (--network host, host networking)
A container with no network namespace of its own: it uses the host's interfaces and ports directly. No isolation, -p is ignored, and ports clash with the host's. Lesson 13.15
host-gateway (host.docker.internal, --add-host)
A special value for --add-host NAME:host-gateway that puts the host's bridge address in the container's /etc/hosts, so the container can reach services on the host by a name. Lesson 13.15
JAVA_TOOL_OPTIONS
An environment variable every JVM reads extra flags from. -e JAVA_TOOL_OPTIONS=-XX:MaxRAMPercentage=75 changes the heap without touching the image. Lesson 13.10
json-file
Docker's default logging driver: one JSON line per log line in /var/lib/docker/containers/<id>/<id>-json.log. Never rotated unless you set max-size. Lesson 13.26
live-restore
A daemon.json setting that keeps containers running while dockerd itself restarts. Off by default, so restarting dockerd stops every container and starts again only those whose policy says so.
local driver
A Docker logging driver that stores logs compressed and rotates them by default, while docker logs keeps working. A safer default than json-file. Lesson 13.26
log level (log levels, DEBUG, INFO)
How serious a log line is, from chattiest to worst: TRACE, DEBUG, INFO, WARN, ERROR. A program set to WARN prints only WARN and ERROR lines.
log rotation
Closing a log file when it reaches a size and starting a new one, keeping only a few old files. Docker's json-file driver does this only if you set max-size and max-file. Lesson 13.26
logging driver (log driver, log-driver)
The Docker plug-in that decides where a container's stdout and stderr go: a file on the host (json-file, local), the journal, a central log system, or nowhere (none). Lesson 13.26
max-size (max-file, log-opts, --log-opt)
Log rotation settings for Docker's json-file driver: start a new file at max-size and keep at most max-file files, deleting the oldest. Set per container or in daemon.json. Lesson 13.26
named volume (named volumes)
A volume with a name you chose (-v pgdata:/path), kept by Docker under /var/lib/docker/volumes/. It survives docker rm, and when empty it is first filled from the image, with the image's file owners. Lesson 13.1
network alias (--network-alias)
An extra DNS name for a container on a network. Compose gives every container its service name as an alias, so db resolves. Lesson 13.15
network isolation (isolated networks)
Containers on different Docker networks cannot reach each other at all: Docker's firewall rules drop the packets, so it looks like a timeout. Connect one container to both networks instead. Lesson 13.15
no-new-privileges (NoNewPrivs)
A setting (--security-opt no-new-privileges) that stops a process and its children from gaining privileges through setuid programs like sudo. Same as systemd's NoNewPrivileges=. Lesson 13.29
pg_dump
Postgres's own tool for a consistent backup of a database, safe to run while it is serving. Lesson 13.22
pg_isready
A small Postgres tool that answers "is the database accepting connections yet?". The usual healthcheck command for a postgres container. Lesson 13.31
psql
The Postgres command-line client: a shell for typing SQL at a database. Lesson 13.31
RestartCount
How many times Docker has restarted a container because of its restart policy: docker inspect -f '{{.RestartCount}}' NAME. Lesson 13.5
service_healthy (service_completed_successfully)
A depends_on condition: wait until the other service's healthcheck reports healthy before starting this one. Lesson 13.31
unless-stopped
A restart policy like always (restart after any exit), except that a container you stopped by hand stays stopped even after the daemon restarts or the host reboots. Lesson 13.1
user-defined network (user-defined bridge, docker network create)
A bridge network you create with docker network create NAME. Same as the default bridge plus Docker's DNS, so containers on it reach each other by name. Lesson 13.15
userns-remap
A daemon.json setting that turns on user namespaces for containers, so root inside a container is an unprivileged uid on the host. Lesson 13.29