buildkit: Handle client cache import options
Cache imports must be explicitly handled by the BuildKit gateway. They
are not handled automatically by buildkitd
or by dockerfile2llb
.
Implementation was basically copy/pasted from upstream's dockerfile
frontend.
Note that there are two possible forms of client options in <= v0.10
of the BuildKit client (buildctl
and docker buildx
). Upstream's
master
branch, however, normalizing the options into a single form.
Once upstream cuts a new minor version and we adopt it, we can remove
the old cache-from
form.
Bug: T323149