A minimal CLI tool to pull container image layers from Docker Hub's registry API. Written in Go, no Docker daemon required.
Pulli authenticates with Docker Hub, resolves platform-specific image manifests, and downloads individual layer blobs to disk.
git clone https://github.com/xputerax/pulli.git
cd pulli
go build -o pulli .- Go 1.25 or later
pulli <image-name> [architecture] [os]| Argument | Default | Description |
|---|---|---|
image-name |
required | Docker Hub library image name (e.g. ubuntu, alpine, nginx) |
architecture |
amd64 |
Target CPU architecture |
os |
linux |
Target operating system |
# Pull the default linux/amd64 layer for alpine
./pulli alpine
# Pull the arm64 layer for ubuntu
./pulli ubuntu arm64
# Pull the linux/arm/v7 layer for nginx
./pulli nginx arm linuxThe downloaded layer blob is written to stdout.
- Authenticate — obtains a bearer token from
auth.docker.iofor the requested repository. - Fetch manifest list — queries the Docker Hub v2 registry for the image's manifest list (
latesttag). - Resolve platform — filters manifests by the requested architecture and OS.
- Fetch specific manifest — retrieves the platform-specific manifest to get layer digests.
- Check blob existence — sends a
HEADrequest to verify the layer blob is available. - Download blob — streams the layer blob to stdout.
A bash equivalent of the full flow is provided in pull-image.sh for reference or quick one-off usage. It requires curl and jq.
- Only supports Docker Hub library images (no private registries, no custom namespaces).
- Always pulls the
latesttag. - Only downloads the first layer blob.
MIT