Why should containers run as non-root?
Running as a non-root user reduces the impact of a container compromise and supports least-privilege defense in depth.
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1465–1476 of 3610 questions
Running as a non-root user reduces the impact of a container compromise and supports least-privilege defense in depth.
A client reaches an exposed entry point, which routes to a Service; the Service forwards traffic to ready Pods managed by a Deployment.
A multi-stage build uses separate stages for compilation and runtime so build tools and intermediate files do not need to be included in the final image.
Docker caches instructions and their inputs. If a step and its dependencies are unchanged, Docker may reuse that layer; order stable dependency steps before frequently changing sou
Define each service and a named volume for database persistence. Use service DNS names for container-to-container traffic.
Bridge networks connect containers on one Docker host. Host networking shares the host network namespace on supported platforms. Overlay networks connect services across hosts in c
Use trusted minimal base images, pin versions or digests, update dependencies, scan images, avoid secrets in layers, and run with least privilege.
Runtime flags constrain CPU scheduling and memory use. If memory exceeds its limit, the container may be killed by the kernel.
The API server exposes the Kubernetes API; etcd stores cluster state; the scheduler places Pods; and controller managers reconcile desired state.
The scheduler filters nodes against Pod constraints and then scores feasible nodes; the selected node is bound to the Pod.
Requests influence scheduling and represent expected resource needs. Limits cap resource use; CPU is throttled above its limit, while memory overage can trigger an OOM kill.
HPA adjusts a workload's replica count based on observed metrics relative to targets, commonly CPU or memory utilization or custom metrics.