Docker image downloader — bypass docker pull by downloading image layers directly from the registry.
Based on Moby's download-frozen-image-v2.sh with improvements: aria2c parallel downloads, multi-registry support, resume, checksum verification, and colored output.
When docker pull is blocked (sanctions, 403 from docker.io, corporate proxies), this tool downloads image layers via aria2c, creates a tarball, and loads it into Docker.
# instead of:
docker pull hello-world:latest
# use:
./docker_dn -d output -i hello-world:latest| Registry | Prefix |
|---|---|
| Docker Hub | (default) |
| GitHub Container Registry | ghcr.io/ |
| Google Container Registry | gcr.io/ |
| Quay | quay.io/ |
sudo apt install curl jq aria2c tar gzip docker.iogit clone git@github.com:esmaeelE/docker_download.git
cd docker_download
chmod +x docker_dnOptional — install globally:
sudo mv docker_dn /usr/local/bin/docker_dn -d dir -i image[:tag][@digest] ... [options]
Options:
-d DIR Output directory for downloading layers
-i IMAGE Image name with optional tag/digest (can be repeated)
-f FILE Read image list from file (one per line)
-o FILE Archive output filename (default: <image>.tar.gz)
--proxy URL Proxy URL for curl and aria2c (e.g. http://host:port)
--clean Remove download directory after successful load
--no-load Download and archive only, skip docker load
--dry-run Show what would be downloaded, then exit
--verbose Show debug output
--quiet Suppress non-error output
--version Show version
-h, -? Show this help message
./docker_dn -d hello_dir -i hello-world:latest./docker_dn -d out -i nginx:alpine --no-load
# creates out/nginx_alpine.tar.gz./docker_dn -d out -i redis:7 -o redis-bundle.tar.gzcat images.txt
# hello-world:latest
# nginx:alpine
# postgres:16
./docker_dn -d out -f images.txt --no-load./docker_dn -d out -i nginx:alpine --proxy http://10.0.0.1:8080./docker_dn -d out -i nginx:alpine --quiet --clean- Parallel downloads —
aria2cwith 16 connections per layer - Resume — interrupted downloads resume from where they stopped (
.donefile tracks completed layers) - Checksum verification — SHA-256 verified against manifest digest after each download
- Disk space check — warns if image size exceeds available disk space
- Multi-registry — Docker Hub, GHCR, GCR, Quay auto-detected from image prefix
- Colored output — errors in red, warnings in yellow, success in green (auto-disabled in non-terminal /
--quiet) - Cleanup trap — partial downloads preserved on failure for resume
If docker.io blocks your IP (403 Forbidden), use the built-in proxy flag:
./docker_dn -d out -i nginx:alpine --proxy 10.10.34.42:8080Or set proxy via environment:
export {http,https,ftp}_proxy="10.10.34.42:8080"
./docker_dn -d out -i nginx:alpineOr use proxychains:
proxychains4 ./docker_dn -d out -i nginx:alpine| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Usage error / dependency missing |
| 2 | Auth failure |
| 3 | Download / checksum failure |
| 4 | Docker load failure |
- Debian 12, 13
- Ubuntu 24.04