Casting container images to gzipped tarballs.
Thape is a lightweight HTTP service that allows you to download container images as gzipped tarballs (.tgz) directly from your browser or any HTTP client.
The service is designed to be simple and efficient, providing an easy way to export container images for backup, distribution, or analysis purposes.
Thape is required working with Go 1.24 or later.
The service is designed to work with:
• Container registries supporting the OCI Distribution Specification • Docker Hub and other public registries • Private registries with HTTP Basic Authentication
To build and run Thape:
# Using Makefile
make
cp .env.sample .env
./build/thape
# Or manually
go build ./cmd/thape
APP_MODE=development HTTP_HOST=localhost HTTP_PORT=8080 ./thapeThe service is recommended to be used for light to medium loading tasks.
Thape provides a simple HTTP API for downloading container images as gzipped tarballs. The service pulls images using the go-containerregistry library and streams them directly to the client as compressed archives.
The service supports:
- Public container images from any OCI-compliant registry
- Private images with HTTP Basic Authentication
- Multi-architecture image selection
- Custom filename specification
The service uses environment variables for configuration:
APP_MODE=development
HTTP_HOST=localhost
HTTP_PORT=8080The configuration is managed using the nui.go package, which reads environment variables and provides a clean interface for configuration management.
You can copy the .env.sample file to .env and modify it according to your needs:
cp .env.sample .envNote: All environment variables are required. The service will not start without them.
Install the Go module dependencies:
go mod downloadFor development with hot-reload capabilities:
# Using Makefile (recommended)
make dev
# Or manually install air
go install github.com/air-verse/air@latest
airBuild and run the service for production:
# Using Makefile
make
./build/thape
# Or manually
go build -o thape ./cmd/thape
./thapeFor containerized deployment:
docker build -t thape .
docker run -p 8080:8080 thapeService information and usage instructions
Returns information about how to use the Thape service, including examples for public and private images.
Download container image as gzipped tarball
Downloads the specified container image as a gzipped tarball (.tgz).
Parameters:
image_name: The name of the container imagetag: The image tag or digest
Query Parameters:
arch: Architecture specification (e.g.,linux/arm64)name: Custom filename for the download
Examples:
Public image:
GET /alpine:latest
Public image with custom filename:
GET /alpine:latest?name=my-alpine
Multi-architecture image:
GET /alpine:latest?arch=linux/arm64
Authentication:
For private images, use HTTP Basic Authentication:
curl -u username:password http://localhost:8080/private/image:tagResponse:
The service returns the image as a gzipped tarball with appropriate headers:
Content-Type: application/x-gzipContent-Disposition: attachment; filename="{image_name}_{tag}.tgz"
Thape is the container image export service with BSD-3-Clause licensed.
(c) 2025 Star Inc.