1
0
mirror of https://github.com/moby/buildkit.git synced 2025-04-18 18:04:03 +03:00

remotecache: enable image-manifest by default

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2025-04-07 17:00:52 -07:00
parent 51c2f90c2c
commit f6a7201314
No known key found for this signature in database
GPG Key ID: AFA9DE5F8AB7AF39
5 changed files with 8 additions and 9 deletions

View File

@ -462,7 +462,7 @@ buildctl build ... \
* `min`: only export layers for the resulting image
* `max`: export all the layers of all intermediate steps
* `ref=<ref>`: specify repository reference to store cache, e.g. `docker.io/user/image:tag`
* `image-manifest=<true|false>`: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: `false`, must be used with `oci-mediatypes=true`)
* `image-manifest=<true|false>`: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: `true` since BuildKit `v0.21`, must be used with `oci-mediatypes=true`)
* `oci-mediatypes=<true|false>`: whether to use OCI mediatypes in exported manifests (default: `true`, since BuildKit `v0.8`)
* `compression=<uncompressed|gzip|estargz|zstd>`: choose compression type for layers newly created and cached, gzip is default value. estargz and zstd should be used with `oci-mediatypes=true`
* `compression-level=<value>`: choose compression level for gzip, estargz (0-9) and zstd (0-22)
@ -489,7 +489,7 @@ The directory layout conforms to OCI Image Spec v1.0.
* `max`: export all the layers of all intermediate steps
* `dest=<path>`: destination directory for cache exporter
* `tag=<tag>`: specify custom tag of image to write to local index (default: `latest`)
* `image-manifest=<true|false>`: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: `false`, must be used with `oci-mediatypes=true`)
* `image-manifest=<true|false>`: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: `true` since BuildKit `v0.21`, must be used with `oci-mediatypes=true`)
* `oci-mediatypes=<true|false>`: whether to use OCI mediatypes in exported manifests (default `true`, since BuildKit `v0.8`)
* `compression=<uncompressed|gzip|estargz|zstd>`: choose compression type for layers newly created and cached, gzip is default value. estargz and zstd should be used with `oci-mediatypes=true`.
* `compression-level=<value>`: compression level for gzip, estargz (0-9) and zstd (0-22)

View File

@ -51,7 +51,7 @@ func ResolveCacheExporterFunc(sm *session.Manager) remotecache.ResolveCacheExpor
}
ociMediatypes = b
}
imageManifest := false
imageManifest := true
if v, ok := attrs[attrImageManifest]; ok {
b, err := strconv.ParseBool(v)
if err != nil {

View File

@ -69,7 +69,7 @@ func ResolveCacheExporterFunc(sm *session.Manager, hosts docker.RegistryHosts) r
}
ociMediatypes = b
}
imageManifest := false
imageManifest := true
if v, ok := attrs[attrImageManifest]; ok {
b, err := strconv.ParseBool(v)
if err != nil {

View File

@ -5661,8 +5661,9 @@ func testZstdLocalCacheExport(t *testing.T, sb integration.Sandbox) {
{
Type: "local",
Attrs: map[string]string{
"dest": destDir,
"compression": "zstd",
"dest": destDir,
"image-manifest": "false",
"compression": "zstd",
},
},
},
@ -5913,7 +5914,6 @@ func testImageManifestRegistryCacheImportExport(t *testing.T, sb integration.San
Type: "registry",
Attrs: map[string]string{
"ref": target,
"image-manifest": "true",
"oci-mediatypes": "true",
"mode": "max",
},
@ -5947,6 +5947,7 @@ func testZstdRegistryCacheImportExport(t *testing.T, sb integration.Sandbox) {
"ref": target,
"compression": "zstd",
"force-compression": "true",
"image-manifest": "false",
"oci-mediatypes": "true", // containerd applier supports only zstd with oci-mediatype.
},
}

View File

@ -5802,7 +5802,6 @@ COPY --from=base unique /
Attrs: map[string]string{
"ref": target,
"oci-mediatypes": "true",
"image-manifest": "true",
},
},
},
@ -8985,7 +8984,6 @@ COPY --link foo foo
Attrs: map[string]string{
"ref": target + "-cache",
"oci-mediatypes": "true",
"image-manifest": "true",
},
},
},