1
0
Fork 0
mirror of https://github.com/imjasonh/kontain.me synced 2026-07-07 00:32:28 +00:00
No description
Find a file
Claude 61e2ace4bc
git: stream worktree into the layer instead of unpacking to disk
git.kontain.me used to clone+checkout a repo onto Cloud Run's tmpfs (memory)
and then tar the result. Now it fetches the packfile into an in-memory git dir,
walks the requested commit's tree, and streams each blob straight into the
layer tar. Only the packfile bytes (plus go-git's delta cache) are buffered, so
memory no longer scales with the size of the checked-out worktree.

The shipped .git directory is preserved (with core.bare unset and a generated
index) so the git CLI still works inside the checkout. Object SHAs change since
the tar is rebuilt differently, but the contents are the same.

https://claude.ai/code/session_01Jfhuuwb5haNaasc9hs53jw
2026-05-12 14:54:11 +00:00
.github update deps 2026-05-12 09:09:26 -04:00
cmd git: stream worktree into the layer instead of unpacking to disk 2026-05-12 14:54:11 +00:00
pkg put the train back on its rails 2025-02-14 03:52:52 -06:00
.gitignore
.terraform.lock.hcl update deps 2026-05-12 09:09:26 -04:00
apps.tf add git.kontain.me 2026-05-11 21:42:04 -04:00
go.mod git: stream worktree into the layer instead of unpacking to disk 2026-05-12 14:54:11 +00:00
go.sum update deps 2026-05-12 09:09:26 -04:00
LICENSE
main.tf put the train back on its rails 2025-02-14 03:52:52 -06:00
prober.tf put the train back on its rails 2025-02-14 03:52:52 -06:00
README.md add git.kontain.me 2026-05-11 21:42:04 -04:00

kontain.me

CI Deploy

Serving container images generated on-demand, at the time they are requested.

These include:

  • random.kontain.me, which serves randomly-generated images.
  • mirror.kontain.me, which pulls and caches images from other registries.
  • flatten.kontain.me, which pulls and flattens images from other registries, so they contain only one layer.
  • ko.kontain.me, which builds a Go binary into a container image using ko.
  • apko.kontain.me, which builds a minimal base image containing APK packages, using apko.
  • git.kontain.me, which serves an image containing a shallow clone of a Git repo at a given branch, tag, or commit, using go-git.
  • wait.kontain.me, which enqueues a background task to serve a random image after some amount of time.

This repo also serves viz.kontain.me, which visualizes shared image layers using Graphviz.

There's also two other services in this random grab-bag:

  • infinite-git.kontain.me generates a new Git commit every time the repo is pulled
  • infinite-go.kontain.me (also in the infinite-git repo) generates new Go module version every time it's fetched

Caveats

  • The registry does not accept pushes.
  • This is a silly hack and probably isn't stable. Don't rely on it for anything serious.
  • It could probably do a lot of smart things to be a lot faster. 🤷
  • Blobs and manifests are cached for 24 hours wherever possible, but will be rebuilt from scratch after that time.

How it works

The service is implemented using Google Cloud Run.

When the service receives a request for an image manifest, it parses the request and generates layers for the requested image, writing the manifest and blobs to Google Cloud Storage. After it receives the manifest, docker pull fetches the blobs. The app simply redirects to Cloud Storage to serve manifests and blobs.