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
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.
Model You manage Provider manages Example On premises everything nothing your own data centre IaaS (infrastructure) OS, runtime, app, data hardware, virtualisation, network virtual machines, block storage PaaS (platform) app and data OS, runtime, scaling managed app platforms, managed databases FaaS / serverless function code everything else, including scaling event-triggered functions SaaS (software) your usage and settings the whole application email, CRM, collaboration tools More managed means less work and less control. Less managed means more flexibility, and more to operate.
100%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.
100%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
Related reading
- TechWorld with Nana: Docker & KubernetesNana Janashia · TechWorld with NanaYouTube
- AWS Containers BlogAmazon Web Services engineers · Amazon Web ServicesBlogs
- Awesome KubernetesRamit Surana · ramitsuranaGitHub
- Kubernetes ConceptsKubernetes Authors · CNCF / KubernetesDocumentation
Show 6 moreShow fewer
- Docker BlogDocker engineers · DockerBlogs
- Docker OverviewDocker · Docker Inc.Documentation
- Docker Containers that Power Over 100.000 Online Shops at ShopifyShopify engineers · ShopifyCase Studies
- Build Your Own XCodeCrafters · GitHubGitHub
- Docker Engineering BlogDocker engineers · DockerBlogs
- Scaling Git at Microsoft - Saeed Noursalehi, Principal Program Manager at MicrosoftMicrosoftYouTube
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Unprivileged Container Builds at Kinvolk.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
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)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Clock Skew when Syncing Password Payloads at Drobbox
How Dropbox Passwords fixed sync errors from clock skew by replacing a two-way timestamp merge with a three-way merge against a base payload.
DrobboxIntermediate
Case Studies · Read here
OAuth Audit Toolbox at Indeed
Integrating third party apps with GSuite can be risky. Indeed's OAudit Toolbox allows you to educate your users and improve application security.
IndeedIntermediate
Read the codeSee how it looks when it is real.
GitHub
Awesome Kubernetes
Resources for learning and operating Kubernetes, from tutorials to production tooling.
ramitsuranaIntermediate
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
Keep learning
Loading community…