Skip to content
Merged
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
5 changes: 3 additions & 2 deletions pkg/bypass4netnsutil/bypass4netnsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import (
"path/filepath"
"strconv"

"github.com/opencontainers/runtime-spec/specs-go"
b4nnoci "github.com/rootless-containers/bypass4netns/pkg/oci"

"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/nerdctl/v2/pkg/annotations"
"github.com/opencontainers/runtime-spec/specs-go"
b4nnoci "github.com/rootless-containers/bypass4netns/pkg/oci"
)

func generateSecurityOpt(listenerPath string) (oci.SpecOpts, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/clientutil/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ import (
"runtime"
"strings"

"github.com/opencontainers/go-digest"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/pkg/namespaces"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/platformutil"
"github.com/containerd/nerdctl/v2/pkg/systemutil"
"github.com/containerd/platforms"
"github.com/opencontainers/go-digest"
)

func NewClient(ctx context.Context, namespace, address string, opts ...containerd.Opt) (*containerd.Client, context.Context, context.CancelFunc, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"os"
"path/filepath"

ocispec "github.com/opencontainers/image-spec/specs-go/v1"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/errdefs"
"github.com/containerd/nerdctl/v2/pkg/api/types"
Expand All @@ -36,7 +38,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/signutil"
"github.com/containerd/nerdctl/v2/pkg/strutil"
"github.com/containerd/platforms"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

// New returns a new *composer.Composer.
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/container/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import (
"strconv"
"strings"

dockercliopts "github.com/docker/cli/opts"
dockeropts "github.com/docker/docker/opts"
"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/cio"
Expand All @@ -55,9 +59,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/containerd/nerdctl/v2/pkg/strutil"
dockercliopts "github.com/docker/cli/opts"
dockeropts "github.com/docker/docker/opts"
"github.com/opencontainers/runtime-spec/specs-go"
)

// Create will create a container.
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/container/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (
"io"
"os"

"github.com/opencontainers/runtime-spec/specs-go"

"github.com/containerd/console"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/pkg/cio"
Expand All @@ -33,7 +35,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/idutil/containerwalker"
"github.com/containerd/nerdctl/v2/pkg/signalutil"
"github.com/containerd/nerdctl/v2/pkg/taskutil"
"github.com/opencontainers/runtime-spec/specs-go"
)

// Exec will find the right running container to run a new command.
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/container/exec_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
package container

import (
"github.com/containerd/containerd/v2/pkg/cap"
"github.com/opencontainers/runtime-spec/specs-go"

"github.com/containerd/containerd/v2/pkg/cap"
)

func setExecCapabilities(pspec *specs.Process) error {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/container/run_cgroup_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ import (
"path/filepath"
"strings"

"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"

"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/infoutil"
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"
)

type customMemoryOptions struct {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/container/run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import (
"fmt"
"strings"

"github.com/moby/sys/userns"
"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
Expand All @@ -32,8 +35,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/ipcutil"
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/containerd/nerdctl/v2/pkg/strutil"
"github.com/moby/sys/userns"
"github.com/opencontainers/runtime-spec/specs-go"
)

// WithoutRunMount returns a SpecOpts that unmounts the default tmpfs on "/run"
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/container/run_mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ import (
"strings"
"time"

securejoin "github.com/cyphar/filepath-securejoin"
"github.com/moby/sys/userns"
"github.com/opencontainers/image-spec/identity"
"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/core/leases"
Expand All @@ -44,10 +49,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/mountutil"
"github.com/containerd/nerdctl/v2/pkg/mountutil/volumestore"
"github.com/containerd/nerdctl/v2/pkg/strutil"
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/moby/sys/userns"
"github.com/opencontainers/image-spec/identity"
"github.com/opencontainers/runtime-spec/specs-go"
)

// copy from https://github.com/containerd/containerd/blob/v1.6.0-rc.1/pkg/cri/opts/spec_linux.go#L129-L151
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/container/run_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import (
"context"
"strings"

"github.com/opencontainers/runtime-spec/specs-go"

runcoptions "github.com/containerd/containerd/api/types/runc/options"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/containerd/v2/plugins"
"github.com/containerd/log"
"github.com/opencontainers/runtime-spec/specs-go"
)

func generateRuntimeCOpts(cgroupManager, runtimeStr string) ([]containerd.NewContainerOpts, error) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/container/run_ulimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"context"
"strings"

"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"

"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/nerdctl/v2/pkg/strutil"
"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"
)

func generateUlimitsOpts(ulimits []string) ([]oci.SpecOpts, error) {
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/container/run_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import (
"fmt"
"strings"

"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/docker/go-units"
"github.com/opencontainers/runtime-spec/specs-go"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions pkg/cmd/image/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ import (
"os"
"strings"

"github.com/klauspost/compress/zstd"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

overlaybdconvert "github.com/containerd/accelerated-container-image/pkg/convertor"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
Expand All @@ -43,8 +46,6 @@ import (
estargzexternaltocconvert "github.com/containerd/stargz-snapshotter/nativeconverter/estargz/externaltoc"
zstdchunkedconvert "github.com/containerd/stargz-snapshotter/nativeconverter/zstdchunked"
"github.com/containerd/stargz-snapshotter/recorder"
"github.com/klauspost/compress/zstd"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

func Convert(ctx context.Context, client *containerd.Client, srcRawRef, targetRawRef string, options types.ImageConvertOptions) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/image/crypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"errors"
"fmt"

ocispec "github.com/opencontainers/image-spec/specs-go/v1"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/images/converter"
Expand All @@ -29,7 +31,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/platformutil"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

func Crypt(ctx context.Context, client *containerd.Client, srcRawRef, targetRawRef string, encrypt bool, options types.ImageCryptOptions) error {
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/image/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import (
"text/template"
"time"

"github.com/docker/go-units"
"github.com/opencontainers/image-spec/identity"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/images"
Expand All @@ -39,9 +43,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/formatter"
"github.com/containerd/nerdctl/v2/pkg/imgutil"
"github.com/containerd/platforms"
"github.com/docker/go-units"
"github.com/opencontainers/image-spec/identity"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

// ListCommandHandler `List` and print images matching filters in `options`.
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/image/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import (
"context"
"fmt"

"github.com/opencontainers/go-digest"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/images"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/imgutil"
"github.com/containerd/platforms"
"github.com/opencontainers/go-digest"
)

// Prune will remove all dangling images. If all is specified, will also remove all images not referenced by any container.
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/image/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import (
"os"
"path/filepath"

distributionref "github.com/distribution/reference"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
"github.com/containerd/containerd/v2/core/images"
Expand All @@ -44,9 +48,6 @@ import (
"github.com/containerd/stargz-snapshotter/estargz"
"github.com/containerd/stargz-snapshotter/estargz/zstdchunked"
estargzconvert "github.com/containerd/stargz-snapshotter/nativeconverter/estargz"
distributionref "github.com/distribution/reference"
"github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

// Push pushes an image specified by `rawRef`.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import (
dockercliconfig "github.com/docker/cli/cli/config"
dockercliconfigtypes "github.com/docker/cli/cli/config/types"
"github.com/docker/docker/api/types/registry"
"github.com/docker/docker/errdefs"
"golang.org/x/net/context/ctxhttp"
"golang.org/x/term"

"github.com/containerd/containerd/v2/core/remotes/docker"
"github.com/containerd/containerd/v2/core/remotes/docker/config"
"github.com/containerd/errdefs"
"github.com/containerd/log"
"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/errutil"
Expand Down
3 changes: 2 additions & 1 deletion pkg/containerdutil/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ package containerdutil
import (
"context"

ocispec "github.com/opencontainers/image-spec/specs-go/v1"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/content"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)

// ContentStore should be called to get a Provider with caching
Expand Down
3 changes: 2 additions & 1 deletion pkg/containerdutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package containerdutil
import (
"context"

"github.com/containerd/containerd/v2/core/content"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

"github.com/containerd/containerd/v2/core/content"
)

var ReadBlob = readBlobWithCache()
Expand Down
3 changes: 2 additions & 1 deletion pkg/containerutil/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import (
"runtime"
"strings"

"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/pkg/oci"
"github.com/containerd/nerdctl/v2/pkg/ipcutil"
"github.com/containerd/nerdctl/v2/pkg/labels"
"github.com/containerd/nerdctl/v2/pkg/netutil/nettype"
"github.com/opencontainers/runtime-spec/specs-go"
)

// ReconfigNetContainer reconfigures the container's network namespace path.
Expand Down
3 changes: 2 additions & 1 deletion pkg/containerutil/container_network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
"runtime"
"strings"

"github.com/opencontainers/runtime-spec/specs-go"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
"github.com/containerd/containerd/v2/pkg/oci"
Expand All @@ -40,7 +42,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/netutil/nettype"
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/containerd/nerdctl/v2/pkg/strutil"
"github.com/opencontainers/runtime-spec/specs-go"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions pkg/containerutil/containerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
"strings"
"time"

"github.com/moby/sys/signal"
"github.com/opencontainers/runtime-spec/specs-go"

"github.com/containerd/console"
containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/containers"
Expand All @@ -46,8 +49,6 @@ import (
"github.com/containerd/nerdctl/v2/pkg/rootlessutil"
"github.com/containerd/nerdctl/v2/pkg/signalutil"
"github.com/containerd/nerdctl/v2/pkg/taskutil"
"github.com/moby/sys/signal"
"github.com/opencontainers/runtime-spec/specs-go"
)

// PrintHostPort writes to `writer` the public (HostIP:HostPort) of a given `containerPort/protocol` in a container.
Expand Down
3 changes: 2 additions & 1 deletion pkg/idutil/imagewalker/imagewalker.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
"regexp"
"strings"

"github.com/opencontainers/go-digest"

containerd "github.com/containerd/containerd/v2/client"
"github.com/containerd/containerd/v2/core/images"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
"github.com/opencontainers/go-digest"
)

type Found struct {
Expand Down
Loading