Docker image production nên tối ưu security thế nào?

Image production nên dùng base image nhỏ, pin version, giảm packages thừa, chạy non-root, không chứa secrets, scan vulnerabilities, ký/verify image nếu pipeline yêu cầu và cập nhật dependency đều đặn.

Ví dụ non-root:

RUN addgroup -S app && adduser -S app -G app
USER app

Distroless hoặc slim image có thể giảm surface, nhưng cần đảm bảo observability/debug strategy vì image quá tối giản có thể thiếu shell/tools khi xử lý incident.

Xem toàn bộ Docker & Kubernetes cùng filter theo level & chủ đề con.

Mở danh sách Docker & Kubernetes