Introduces a locallayout package and a new imgutil.CNBImage struct.
The CNBImage struct wraps a v1.Image, which could be locallayout, remote, layout, etc. and performs all the modifications to the image that are necessary for a CNB build (such as re-using a layer from a previous image).
locallayout.Image implements a v1.Image by wrapping output from the daemon. However, it does not contain any CNB logic. It does have code that is specific to constructing new images and saving them to the daemon.
This should eventually allow us to delete duplicated code in the remote & layout packages that modifies images in those packages, as we can remove all of the CNB logic (and then some).
Additionally, this should make it easier for us to send images to the daemon in OCI layout format.
This PR simply adds code but if locallayout.Image works well in place of local.Image we can remove local.
Partially resolves https://github.com/buildpacks/imgutil/issues/207
Introduces a
locallayout
package and a newimgutil.CNBImage
struct.The
CNBImage
struct wraps av1.Image
, which could belocallayout
,remote
,layout
, etc. and performs all the modifications to the image that are necessary for a CNB build (such as re-using a layer from a previous image).locallayout.Image
implements av1.Image
by wrapping output from the daemon. However, it does not contain any CNB logic. It does have code that is specific to constructing new images and saving them to the daemon.This should eventually allow us to delete duplicated code in the
remote
&layout
packages that modifies images in those packages, as we can remove all of the CNB logic (and then some).Additionally, this should make it easier for us to send images to the daemon in OCI layout format.
This PR simply adds code but if
locallayout.Image
works well in place oflocal.Image
we can removelocal
.