google / google/go-containerregistry

`daemon.Write` implementation is pretty naive

Open
#205 8 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue lifecycle/frozen
Dominant language
Go
Stars
4k
Forks
686
Avg merge
2d 12h
Merged PRs (30d)
26

Description

[here](https://github.com/google/go-containerregistry/blob/master/pkg/v1/daemon/write.go#L49)

Today the `daemon.Write` interface just uses `tarball.Write` into the `docker load` interface. While correct, this can be incredibly slow for scenarios like `ko -L` because of its lack of incrementality.

In particular, for a large base image we produce and stream a fat tarball to the daemon for every publish. On top of this, since we don't have a local cache wrapping `remote.Image`, we download the base image every time. `remote.Write` elides both upload *and* download through the careful use of existence checks. We should be equally careful in `daemon.Write`.

One option to explore for this is what `rules_docker` did in its [incremental load script](https://github.com/bazelbuild/rules_docker/blob/master/container/incremental_load.sh.tpl). However, we should be careful to measure how this performs on a full daemon (we've seen superlinear behavior in some of the daemon calls before).

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.