Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions cmd/nerdctl/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
5 changes: 4 additions & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docs/compose.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# nerdctl compose

| :zap: Requirement | nerdctl >= 0.8 |
|-------------------|----------------|

## Usage

The `nerdctl compose` CLI is designed to be compatible with `docker-compose`.
Expand Down
3 changes: 3 additions & 0 deletions docs/cosign.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
3 changes: 3 additions & 0 deletions docs/gpu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Using GPUs inside containers

| :zap: Requirement | nerdctl >= 0.9 |
|-------------------|----------------|

nerdctl provides docker-compatible NVIDIA GPU support.

## Prerequisites
Expand Down
3 changes: 3 additions & 0 deletions docs/ipfs.md
Original file line number Diff line number Diff line change
@@ -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/).
Expand Down
3 changes: 3 additions & 0 deletions docs/multi-platform.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
3 changes: 3 additions & 0 deletions docs/ocicrypt.md
Original file line number Diff line number Diff line change
@@ -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).

Expand Down
3 changes: 3 additions & 0 deletions docs/stargz.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down