Preinstall unpigz tool for faster docker pulls

The Docker daemon will use the unpigz tool, if it’s in the path, to extract the pulled images more efficiently than the default and slow Go based gzip implementation. See https://github.com/moby/moby/pull/35697 for further details.

As for now I’m using the following before_script:

wget http://mirrors.kernel.org/ubuntu/pool/universe/p/pigz/pigz_2.4-1_amd64.deb && sudo dpkg -i pigz_2.4-1_amd64.deb && sudo service docker restart

Thanks!

pigz is available as a stock Ubuntu package so you can install it with

addons:
  apt:
    packages:
      - pigz

Also:

  • Which Docker version is this feature available since?
  • Can you give some figures? Travis VMs only have 2 cores so is there really a significant speedup in this case?

Tried the addons.apt.packages approach but it takes 30 seconds to install, I guess the apt caches are not warm. Installing directly with dpkg takes only 3 seconds.

The check for unpigz should be used since Docker 18.02.

Note that the default gzip implementation is a pure Go port which doesn’t seem to be very fast in the first place, so regardless of the number of cores using unpigz should be faster.

On a ~1Gb image the difference is not huge but is noticeable from 70 seconds to 55 seconds. I guess this is specially useful for images with some very large layers.

1 Like
Imprint