Added --oci-layout-path flag to save image in OCI layout.#744
Added --oci-layout-path flag to save image in OCI layout.#744priyawadhwa merged 4 commits intoGoogleContainerTools:masterfrom
--oci-layout-path flag to save image in OCI layout.#744Conversation
|
@priyawadhwa Could you take a look? Thanks! |
priyawadhwa
left a comment
There was a problem hiding this comment.
@chhsia0 thanks for working on this! A couple suggestions:
- Could we name the flag
--oci-layout-path - Could you add a unit test for this?
|
Sure! Is there a reference unit test I can look at as a sample? I tried to find if there's a unit test for |
--layout-path flag to save image in OCI layout.--oci-layout-path flag to save image in OCI layout.
|
@priyawadhwa Done PTAL! |
|
Hmm seems this is not enough for using Kaniko in Tekton, since Tekton exports the digest of the image index itself instead of the image inside the manifest. Let me chat with the folks there to see what's the appropriate solution for this. |
|
Sounds good! |
2f64f59 to
451fa87
Compare
…mage. Currently the image digest exporter does not implemented the behavior described in the resources doc, which says "if there are multiple versions of the image, the latest will be used." Instead, it reports the digest of `index.json`, which is an image index. This behavior introduces a usability issue: one of the major public container registry --- dockerhub --- does not support OCI image indices, and there are very few tools (if any) that support converting OCI image indices to docker manifest lists. Skopeo currently only support pushing an OCI image index that contain only one image. If the index has more than one images, it requires the user to specify one: containers/skopeo#107 containers/image#400 Essentially, these limitations make the image digest exporter useless. To make this feature useful, the exporter could instead implement the following behavior: 1. If there is only one image in `index.json`, report the image's digest. 2. If there are multiple images, report the digest of the full index. The advantage of this behavior is that, we can immediately use it (in conjunction of GoogleContainerTools/kaniko#744), yet if multi-image manifests are more widely supported, the image digest exporter can still support that without any modification.
…ne image. Currently the image digest exporter does not implemented the behavior described in the resources doc, which says "if there are multiple versions of the image, the latest will be used." Instead, it reports the digest of `index.json`, which is an image index. This behavior introduces a usability issue: one of the major public container registry --- dockerhub --- does not support OCI image indices, and there are very few tools (if any) that support converting OCI image indices to docker manifest lists. Skopeo currently only support pushing an OCI image index that contain only one image. If the index has more than one images, it requires the user to specify one: containers/skopeo#107 containers/image#400 Essentially, these limitations make the image digest exporter useless. To make this feature useful, the exporter could instead implement the following behavior: 1. If there is only one image in `index.json`, report the image's digest. 2. If there are multiple images, report the digest of the full index. The advantage of this behavior is that, we can immediately use it (in conjunction of GoogleContainerTools/kaniko#744), yet if multi-image manifests are more widely supported, the image digest exporter can still support that without any modification.
|
@chhsia0 Can you please rebase? |
Fixed GoogleContainerTools#296. The output manifests may have `application/vnd.docker.distribution.manifest.v2+json` as their media types instead of `application/vnd.oci.image.manifest.v1+json`.
53fe819 to
ba9b616
Compare
|
Done. |
…ne image. Currently the image digest exporter does not implemented the behavior described in the resources doc, which says "if there are multiple versions of the image, the latest will be used." Instead, it reports the digest of `index.json`, which is an image index. This behavior introduces a usability issue: one of the major public container registry --- dockerhub --- does not support OCI image indices, and there are very few tools (if any) that support converting OCI image indices to docker manifest lists. Skopeo currently only support pushing an OCI image index that contain only one image. If the index has more than one images, it requires the user to specify one: containers/skopeo#107 containers/image#400 Essentially, these limitations make the image digest exporter useless. To make this feature useful, the exporter could instead implement the following behavior: 1. If there is only one image in `index.json`, report the image's digest. 2. If there are multiple images, report the digest of the full index. The advantage of this behavior is that, we can immediately use it (in conjunction of GoogleContainerTools/kaniko#744), yet if multi-image manifests are more widely supported, the image digest exporter can still support that without any modification.
|
The related PR in the Tekton project just got merged: tektoncd/pipeline#1237 |
Fixed #296.
The output manifests may have
application/vnd.docker.distribution.manifest.v2+jsonas their media types instead of
application/vnd.oci.image.manifest.v1+json.