
# Hosting images on GitHub

A micro-image is static files, so a Git repository can host it. untainer resolves a short
reference to the image's URL, and checks every chunk against its hash, so the host does not have
to be trusted.

| Reference | Served by | Pin | Size |
| --- | --- | --- | --- |
| `gh:owner/repo/path#tag` | raw.githubusercontent.com | a tag or a commit | files up to 100 MB |
| `gh-pages:owner/repo/path` | GitHub Pages | none: what the branch holds now | files up to 100 MB |
| `jsdelivr:owner/repo/path#tag` | jsDelivr's CDN | a tag or a commit | 50 MB per repository and ref |

## Publish

```sh
untainer build node:24-alpine -o images/node-24-alpine
git add images && git commit -m "add node-24-alpine" && git tag node-24-alpine-v1
git push --follow-tags
```

Then load it by reference. The test images of this project are published that way; this runs
node:24-alpine from them:

```ts [load.ts]
import { createRuntime } from 'untainer';

const rt = await createRuntime({
  images: ['gh:OskarLebuda/untainer-images/node-24-alpine#node-24-alpine-35fb96518a92'],
});
const app = await rt.run('node', { cmd: ['sleep', '60'] });
console.log((await app.exec('node', ['--version'])).stdout); // v24...
await rt.shutdown();
```

**Treat a published tag as immutable:** never move it, never delete it. A new version of an image
is a new tag. A branch moves under a running application, and hosts cache what a branch held:
raw.githubusercontent.com for 5 minutes, jsDelivr up to 12 hours on its CDN and 7 days in a
browser (measured 2026-12-03, [`docs/findings.md`](https://github.com/OskarLebuda/untainer/blob/main/docs/findings.md), "Images from GitHub, live").

## GitHub Pages: `gh-pages:`

Pages has no 50 MB limit, which makes it the way for large images, but it serves only what its
branch holds now: `gh-pages:` cannot be pinned, and `gh-pages:...#v1` is refused rather than
quietly loading the branch. Put an empty `.nojekyll` at the root of the branch so that Pages
serves the files as they are.

## jsDelivr: `jsdelivr:` and `npm:`

jsDelivr serves a GitHub repository only up to 50 MB at one ref (the whole tree, not one image):
node:24-alpine is 79.5 MB with its boot bundle (60.3 MB of chunks and a 19.2 MB bundle). Beyond it, it answers 403, and untainer fails
with `ERR_FETCH` naming other hosts. `npm:package/path@version` serves an image published in an
npm package the same way.

## Private repositories

On Node, `createRuntime({ auth: { token } })` sends a GitHub token to raw.githubusercontent.com
(only to the image's own host). A browser refuses `auth`: whatever a page holds, its visitors can
read.
