MediumBuilding a Docker Image Factory From Scratch in Go | by Cheikh seck | Jul, 2026 | MediumSitemapOpen in appSign up<br>Sign in
Medium Logo
Get app<br>Write
Search
Sign up<br>Sign in
Member-only story
Building a Docker Image Factory From Scratch in Go
How to construct container images with nothing but the standard library.
Cheikh seck
11 min read·<br>1 hour ago
Listen
Share
Most teams treat container images as something a build tool produces on their behalf. You write a Dockerfile, hand it to BuildKit, and a few hundred megabytes later you have an image. The build process itself is a black box — a daemon, a cache, a base image you didn’t author, and a format you rarely inspect.<br>This post takes the opposite stance: an image builder is just a program. Given a tarball and a few JSON blobs, any code that can compute a SHA-256 and write files can manufacture a valid OCI image. So instead of reaching for Docker, we’ll build an image factory — a small Go program that ingests layer tarballs, content-addresses them, assembles a manifest, and emits a spec-compliant OCI layout. The same factory can push to a registry and pull images back.<br>The result is a reusable tool, not a one-off trick. As a bonus, the images it produces are tiny — around 8MB for a Go server — because the factory adds nothing you didn’t ask for. But the real value is ownership: you understand and control every byte of the image format.<br>Press enter or click to view image in full size
What a Docker image actually is
Written by Cheikh seck<br>317 followers<br>·20 following
Get your personal AI intern: https://liteagent.cloud/ -- Practice your English with https://www.convose.com/
Help
Status
About
Careers
Press
Blog
Store
Privacy
Rules
Terms
Text to speech