Hardening Docker Containers Workshop

Communities

The workshop reference on container security—what a container actually is, and how to harden the image, the build, and the way you run it.

Hardening Docker Containers Workshop

Overview

This is the reference for the workshop and for the discussion afterward. It is written for a mixed room: if you have never run a container, read it straight through, since the terms are defined as they come up and there is a glossary at the end. If you use Docker every day, skim the definitions and go to the commands.

The goal is not to hand you a list of flags to copy. It is to explain what a container actually is—not a small virtual machine, but ordinary processes running on the host’s own kernel, limited by namespaces, cgroups, and capabilities—so that each hardening step makes sense as a consequence of how the system works.

From there it works through starting from a safe base image, adding your code without leaking anything, running with the fewest privileges that still work, two things to never do (--privileged and mounting /var/run/docker.sock), and cutting an image down to what it actually uses. It closes with a checklist, a cheat sheet, and a glossary.

View the full workshop materials

Download the workshop handout (PDF)

Tags: Security Docker Containers Linux Open Source