Skip to content

programmer-my/pulli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulli

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.

Installation

From source

git clone https://github.com/xputerax/pulli.git
cd pulli
go build -o pulli .

Prerequisites

  • Go 1.25 or later

Usage

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

Examples

# 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 linux

The downloaded layer blob is written to stdout.

How It Works

  1. Authenticate — obtains a bearer token from auth.docker.io for the requested repository.
  2. Fetch manifest list — queries the Docker Hub v2 registry for the image's manifest list (latest tag).
  3. Resolve platform — filters manifests by the requested architecture and OS.
  4. Fetch specific manifest — retrieves the platform-specific manifest to get layer digests.
  5. Check blob existence — sends a HEAD request to verify the layer blob is available.
  6. Download blob — streams the layer blob to stdout.

Reference Script

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.

Limitations

  • Only supports Docker Hub library images (no private registries, no custom namespaces).
  • Always pulls the latest tag.
  • Only downloads the first layer blob.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors