diff --git a/cmd/nerdctl/build.go b/cmd/nerdctl/build.go index a8baccd6fcb..10752de7e01 100644 --- a/cmd/nerdctl/build.go +++ b/cmd/nerdctl/build.go @@ -93,7 +93,7 @@ func getBuildkitHost(cmd *cobra.Command) (string, error) { return buildkitutil.GetBuildkitHost(ns) } -func isImageSharable(buildkitHost string, namespace, uuid string) (bool, error) { +func isImageSharable(buildkitHost string, namespace, uuid, snapshotter string) (bool, error) { labels, err := buildkitutil.GetWorkerLabels(buildkitHost) if err != nil { return false, err @@ -111,7 +111,12 @@ func isImageSharable(buildkitHost string, namespace, uuid string) (bool, error) if !ok { return false, nil } - return executor == "containerd" && containerdUUID == uuid && containerdNamespace == namespace, nil + // Compare snapshotter to minimize possibility of hitting issues related to unpacked images. Not necessary, though. + workerSnapshotter, ok := labels["org.mobyproject.buildkit.worker.snapshotter"] + if !ok { + return false, nil + } + return executor == "containerd" && containerdUUID == uuid && containerdNamespace == namespace && workerSnapshotter == snapshotter, nil } func buildAction(cmd *cobra.Command, args []string) error { @@ -235,7 +240,11 @@ func generateBuildctlArgs(cmd *cobra.Command, buildkitHost string, platform, arg if err != nil { return "", nil, false, "", nil, err } - sharable, err := isImageSharable(buildkitHost, ns, info.UUID) + snapshotter, err := cmd.Flags().GetString("snapshotter") + if err != nil { + return "", nil, false, "", nil, err + } + sharable, err := isImageSharable(buildkitHost, ns, info.UUID, snapshotter) if err != nil { return "", nil, false, "", nil, err } diff --git a/docs/build.md b/docs/build.md index 2518a979990..5e83b6b728c 100644 --- a/docs/build.md +++ b/docs/build.md @@ -33,7 +33,10 @@ This limitation can be avoided using containerd worker as mentioned later. ## Setting up BuildKit with containerd worker -### Rootless (requires BuildKit v0.10.0 or later) +### Rootless + +| :zap: Requirement | nerdctl >= 0.18, BuildKit >= 0.10 | +|-------------------|-----------------------------------| ``` $ CONTAINERD_NAMESPACE=default containerd-rootless-setuptool.sh install-buildkit-containerd diff --git a/docs/compose.md b/docs/compose.md index 29a9abb0aad..b0af4bcbe9c 100644 --- a/docs/compose.md +++ b/docs/compose.md @@ -1,5 +1,8 @@ # nerdctl compose +| :zap: Requirement | nerdctl >= 0.8 | +|-------------------|----------------| + ## Usage The `nerdctl compose` CLI is designed to be compatible with `docker-compose`. diff --git a/docs/cosign.md b/docs/cosign.md index e443561d6c3..7e8f3ab0237 100644 --- a/docs/cosign.md +++ b/docs/cosign.md @@ -1,5 +1,8 @@ # Container Image Sign and Verify with cosign tool +| :zap: Requirement | nerdctl >= 0.15 | +|-------------------|-----------------| + [cosign](https://github.com/sigstore/cosign) is tool that allows you to sign and verify container images with the public/private key pairs or without them by providing a [Keyless support](https://github.com/sigstore/cosign/blob/main/KEYLESS.md). diff --git a/docs/gpu.md b/docs/gpu.md index 431aa47207e..37c76492adb 100644 --- a/docs/gpu.md +++ b/docs/gpu.md @@ -1,5 +1,8 @@ # Using GPUs inside containers +| :zap: Requirement | nerdctl >= 0.9 | +|-------------------|----------------| + nerdctl provides docker-compatible NVIDIA GPU support. ## Prerequisites diff --git a/docs/ipfs.md b/docs/ipfs.md index 54eb89f50ca..f53dc977014 100644 --- a/docs/ipfs.md +++ b/docs/ipfs.md @@ -1,5 +1,8 @@ # Distribute Container Images on IPFS (Experimental) +| :zap: Requirement | nerdctl >= 0.14 | +|-------------------|-----------------| + You can distribute container images without registries, using IPFS. IPFS support is completely optional. Your host is NOT connected to any P2P network, unless you opt in to [install and run IPFS daemon](https://docs.ipfs.io/install/). diff --git a/docs/multi-platform.md b/docs/multi-platform.md index ddd62d2d4c4..22113eeccf7 100644 --- a/docs/multi-platform.md +++ b/docs/multi-platform.md @@ -1,5 +1,8 @@ # Multi-platform +| :zap: Requirement | nerdctl >= 0.13 | +|-------------------|-----------------| + nerdctl can execute non-native container images using QEMU. e.g., ARM on Intel, and vice versa. diff --git a/docs/ocicrypt.md b/docs/ocicrypt.md index f5318bd24ba..638aaeb2c92 100644 --- a/docs/ocicrypt.md +++ b/docs/ocicrypt.md @@ -1,5 +1,8 @@ # OCIcrypt +| :zap: Requirement | nerdctl >= 0.7 | +|-------------------|----------------| + nerdctl supports encryption and decryption using [OCIcrypt](https://github.com/containers/ocicrypt) (aka [imgcrypt](https://github.com/containerd/imgcrypt) for containerd). diff --git a/docs/stargz.md b/docs/stargz.md index fc73d128479..b3d4222d5ef 100644 --- a/docs/stargz.md +++ b/docs/stargz.md @@ -1,5 +1,8 @@ # Lazy-pulling using Stargz Snapshotter +| :zap: Requirement | nerdctl >= 0.0.1 | +|-------------------|------------------| + Lazy-pulling is a technique to running containers before completion of pulling the images. See https://github.com/containerd/stargz-snapshotter to learn further information.