GoogleContainerTools / GoogleContainerTools/jib

Eliminate potential duplicate files (layer) in cache and possibly apply consistent layout

Open
#1,982 0 comments 0 reactions 0 assignees View on GitHub
area/jib-core cleanup priority: p4
Dominant language
Java
Stars
14.5k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

For base image layers (downloaded from registries), the layout is

`/layers/<(1) SHA of compressed layer blob>/<(2) SHA of uncompressed layer blob>`

That is, (1) is a directory and (2) is a filename. (1) is directly visible from the manifest JSON. Different registries may use different compression levels/methods (we actually considered using a different compression level for layers from `docker save`), so I think hypothetically it is possible that we duplicate the same (uncompressed) layer file. For example,

`/layers//`
`/layers//`

Now, #1957 implements caching local layers, and the layout is in reverse:

`/local//`

The reason is that we need to be able to query the cache using the SHA of an uncompressed layer first.

It would be nice if we can have consistency across the board. This can potentially remove almost-identical code duplicate in #1957 by following one execution path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.