Library / Case Studies

Unprivileged Container Builds at Kinvolk

Why `docker build` normally needs root, and how Linux user namespaces and mount restrictions could allow unprivileged container builds.

By Kinvolk engineers · Kinvolk · Added 2026-10-12

Open original source

All content belongs to Kinvolk engineers / Kinvolk. We only link to it and give credit. Report a problem

Learn this case study

About 37 min left. Your work is saved as you go.

What you are about to study

Kinvolk explains a real system. You should know the basics: caching, queues and replication.

Ideas you will meet

Distributed Systems
Consensus, time, failure and the fundamentals of scale-out.
Docker
Package and ship applications as containers.
Web Security
OWASP risks, XSS, CSRF, CORS and secure design.

What we already know about this

Our own lessons on these ideas. Read them here before you start, so it makes sense.

  • Core Concepts: How Things Actually Work · 7 minIaaS, PaaS, SaaS, containers and serverlessWhat you manage and what the provider manages in each model, and when each one fits.Read here

    The stack and who manages what

    Every application sits on layers: networking, storage, servers, virtualisation, operating system, runtime, application, data. Cloud models differ in how many layers the provider handles for you.

    ModelYou manageProvider managesExample
    On premiseseverythingnothingyour own data centre
    IaaS (infrastructure)OS, runtime, app, datahardware, virtualisation, networkvirtual machines, block storage
    PaaS (platform)app and dataOS, runtime, scalingmanaged app platforms, managed databases
    FaaS / serverlessfunction codeeverything else, including scalingevent-triggered functions
    SaaS (software)your usage and settingsthe whole applicationemail, CRM, collaboration tools

    More managed means less work and less control. Less managed means more flexibility, and more to operate.

    Figure SDA-CORE-13-1 · Who manages what in each model · © forcsguy.com

    Virtual machines and containers

    • A virtual machine emulates hardware and runs a complete guest OS. Strong isolation, heavier, slower to start.
    • A container packages an app and its dependencies and runs as an isolated process on the host's kernel. Lightweight, starts in seconds, and runs the same everywhere ("works on my machine" problems shrink).
    • Orchestrators such as Kubernetes schedule containers across machines, restart failed ones, scale and roll out updates.

    Figure SDA-CORE-13-2 · Virtual machines and containers · © forcsguy.com

    Serverless

    You provide a function; the platform runs it on demand and bills per execution. Strengths: no servers to manage, scales to zero and up automatically, and you pay for use. Limits: cold starts (first request after idle is slower), maximum run time, limited local state, and harder local testing. Best for event-driven, spiky or glue workloads.

    Choosing

    • Spiky or tiny workloads, small team: serverless or PaaS.
    • Steady high load or special needs: containers or VMs with more control, often cheaper at scale.
    • Need maximum control, compliance or custom hardware: IaaS or on premises.
    • Use managed databases and queues where you can: operating them well is hard.
    • Beware lock-in: prefer open formats (containers, standard SQL) when portability matters.

    More on this site

    Open this lesson with its quiz and exercise

Go deeper on this

A path through videos, articles, other case studies and code on the same ideas as Unprivileged Container Builds at Kinvolk.

  1. Warm upGet the vocabulary first.

  2. WatchHow others solve the same problem, on video.

    Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)

  3. ReadEngineers explain it in their own words.

  4. See it in another companyThe same ideas, a different system.

  5. Read the codeSee how it looks when it is real.

Keep learning

Loading community…