Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8664 bites

Page 36

Docker & Kubernetes1 min read

Bind mounts vs named volumes for persisting Docker data?

Persist data outside the writable container layer via a bind mount (a host path you control) or a named volume (Docker-managed under its data dir, portable and the recommended default).

Docker & Kubernetes1 min read

What happens to volume data when a Pod is deleted?

EmptyDir is tied to the Pod and erased when the Pod is deleted; a PVC-backed PV with Retain keeps the data after the PVC is released for manual recovery.

Docker & Kubernetes1 min read

What are PersistentVolumes and PersistentVolumeClaims for?

A PV is a cluster storage resource the admin provisions; a PVC is a user's request for size and access mode; Kubernetes binds them, decoupling Pods from storage details.

Docker & Kubernetes1 min read

How do Sealed Secrets enable GitOps for secrets?

Kubeseal encrypts a Secret with the controller's public key into a SealedSecret CR safe for Git; only the in-cluster controller's private key can decrypt it into a real Secret.

Docker & Kubernetes1 min read

What do immutable ConfigMaps and Secrets solve?

Setting immutable true blocks data edits, preventing accidental updates and letting the kubelet skip watches, reducing API server load.

Docker & Kubernetes1 min read

How do you inject secrets from an external store at runtime?

Use a sidecar injector or CSI driver that authenticates via the Pod's ServiceAccount token, fetches secrets at runtime, and mounts them on tmpfs.

Docker & Kubernetes1 min read

How do you restrict a Pod's access to a Secret?

Pods read Secrets through their ServiceAccount and RBAC, scoped with resourceNames; mounted Secrets are governed by the Pod spec.

Docker & Kubernetes1 min read

How do you let Pods pull from a private registry?

Create a dockerconfigjson Secret with registry creds; reference it via imagePullSecrets on the Pod or ServiceAccount.

Docker & Kubernetes1 min read

Are base64-encoded Kubernetes Secrets actually secure?

Base64 is reversible, not a protection; default guards against accidental shoulder-surfing only; real defenses are encryption-at-rest, RBAC, audit.

Docker & Kubernetes1 min read

Bind mounts versus named volumes

A bind mount maps a host path into the container (great for live source in dev); a named volume is Docker-managed storage decoupled from the host layout (ideal for database data).

Docker & Kubernetes1 min read

Compose image directive versus build directive

Image pulls a prebuilt image from a registry; build builds from a local Dockerfile and context; use build for your own custom application code.

Docker & Kubernetes1 min read

Manage startup order and readiness in Compose

Depends_on only orders start, not readiness; add a healthcheck to the DB and use depends_on with condition: service_healthy so the web app waits until the DB passes its health check.

Docker & Kubernetes1 min read

Docker Compose default networking

Compose creates one default user-defined bridge network for the project; all services join it and reach each other by service name via embedded DNS, isolated from other projects.

Docker & Kubernetes1 min read

How Compose services reach each other by name

Services share a default network and the web app uses the database's service name as the hostname; Docker's embedded DNS resolves it to the container IP.

Docker & Kubernetes1 min read

Persist PostgreSQL data across compose down

Define a named volume and mount it at the database's data directory (/var/lib/postgresql/data); named volumes survive compose down.

Docker & Kubernetes1 min read

Start Compose services detached and view one service's logs

Docker compose up -d starts everything detached; docker compose logs -f web follows only the web service's logs.

Docker & Kubernetes1 min read

Distroless images: benefits and trade-offs

Distroless ships only the app and runtime deps, no shell or package manager; smaller and a smaller attack surface than Alpine; trade-off is harder debugging with no shell.

Docker & Kubernetes1 min read

Pass build-time secrets securely with BuildKit

Use BuildKit RUN --mount=type=secret (or type=ssh) so the secret is mounted only during that step and never written to a layer; pass it with --secret at build time.

Docker & Kubernetes1 min read

Run a container as a non-root user

Create a dedicated group and user, chown app files to them, then USER to drop privileges before the process runs.

Docker & Kubernetes1 min read

What is a dangling image and how to prune it

A dangling image is an untagged layer (<none>:<none>) orphaned when a tag moves to a rebuilt image; list with docker images -f dangling=true, remove with docker image prune.