jib icon indicating copy to clipboard operation
jib copied to clipboard

Support compression for tar images in jib-core

Open alpar-t opened this issue 4 years ago • 1 comments

Description of the issue:

We use jib-core to implement tooling to deal with a large number of docker images. Some of these are large, build with the docker cli then saved and Jib takes over from there.
We observed that these tend to compress well, close to half the size, and there's a significant amount of
build time we can save by storing and transferring compressed images.

It would be great if Jib would support working with a compressed tar image directly. From poking around it seems that TarExtractor could implement that rather seamlessly, It already relies on commons-compress so it wouldn't introduce additional dependencies either (the implementation of the compression algorithms is a runtime dependency).

Would you consider a PR that adds support for de-compressing the tar archive in TarExtractor based on the file extension ?

alpar-t avatar Nov 16 '20 08:11 alpar-t

Hi @alpar-t,

Sorry for the delay. It makes sense to support a compressed Docker tar image. I just wasn't sure if we should decompress it in TarExtractor or LocalBaseImageSteps.cacheDockerImageTar(). Maybe it's reasonable and simple to do it within TarExtractor.

We welcome your contributions!

chanseokoh avatar Nov 17 '20 23:11 chanseokoh