Home

Awesome

docker-repack - Speed up Docker image pulls

This tool repacks a Docker image into a smaller, more efficient version that makes it significantly faster to pull. It does this by using a few different techniques such as removing redundant data and improving compression ratios. Some examples of improvements:

ImageBeforeAfterReduction
google/deepsomatic16.4GB, 2 minutes 14 seconds4.8GB, 16 seconds3.4x smaller, 8.2x faster
google/deepvariant12.7GB, 1 minute, 2 seconds3GB, 10 seconds6.3x faster, 4.2x smaller
google/cloud-sdk1.1GB, 5 seconds187MB, 1 second3.8x faster, 6.1x smaller
mathworks/matlab2GB, 5 seconds230.7MB, 1 second6.5x faster, 9x smaller
tensorflow/tensorflow3.5GB, 11 seconds2GB, 3 seconds3.3x faster, 1.8x smaller

See the benchmarks page for a full comparison of pulling times across many different images.

Usage

$ docker-repack docker://alpine:latest oci://directory/ --target-size=50MB

Full arguments:

Usage: docker-repack [OPTIONS] --target-size <TARGET_SIZE> <SOURCE> <OUTPUT_DIR>

Arguments:
  <SOURCE>      Source image. e.g. `python:3.11`, `tensorflow/tensorflow:latest` or `oci://local/image/path`
  <OUTPUT_DIR>  Location to save image, e.g oci://directory/path/

Options:
  -t, --target-size <TARGET_SIZE>              Target size for layers
      --concurrency <CONCURRENCY>
      --keep-temp-files
      --compression-level <COMPRESSION_LEVEL>  [default: 14]
      --platform <PLATFORM>                    [default: linux/*]
  -h, --help                                   Print help
  -V, --version                                Print version

Installation

Pre-compiled binaries

Download a release from the releases page

Cargo

cargo install docker-repack