diff --git a/daemon/containerd/imagespec.go b/daemon/containerd/imagespec.go index c251773811..ef516198a9 100644 --- a/daemon/containerd/imagespec.go +++ b/daemon/containerd/imagespec.go @@ -7,7 +7,6 @@ import ( "github.com/moby/moby/api/types/container" "github.com/moby/moby/api/types/network" "github.com/moby/moby/v2/daemon/internal/image" - "github.com/moby/moby/v2/dockerversion" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -18,13 +17,12 @@ import ( // - Details func dockerOciImageToDockerImagePartial(id image.ID, img dockerspec.DockerOCIImage) *image.Image { v1Image := image.V1Image{ - DockerVersion: dockerversion.Version, - Config: dockerOCIImageConfigToContainerConfig(img.Config), - Architecture: img.Platform.Architecture, - Variant: img.Platform.Variant, - OS: img.Platform.OS, - Author: img.Author, - Created: img.Created, + Config: dockerOCIImageConfigToContainerConfig(img.Config), + Architecture: img.Platform.Architecture, + Variant: img.Platform.Variant, + OS: img.Platform.OS, + Author: img.Author, + Created: img.Created, } out := image.NewImage(id) diff --git a/daemon/images/image_import.go b/daemon/images/image_import.go index 5ef0b9ca99..a7abd47c82 100644 --- a/daemon/images/image_import.go +++ b/daemon/images/image_import.go @@ -14,7 +14,6 @@ import ( "github.com/moby/moby/v2/daemon/builder/dockerfile" "github.com/moby/moby/v2/daemon/internal/image" "github.com/moby/moby/v2/daemon/internal/layer" - "github.com/moby/moby/v2/dockerversion" "github.com/moby/moby/v2/errdefs" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -53,13 +52,12 @@ func (i *ImageService) ImportImage(ctx context.Context, newRef reference.Named, created := time.Now().UTC() imgConfig, err := json.Marshal(&image.Image{ V1Image: image.V1Image{ - DockerVersion: dockerversion.Version, - Config: config, - Architecture: platform.Architecture, - Variant: platform.Variant, - OS: platform.OS, - Created: &created, - Comment: msg, + Config: config, + Architecture: platform.Architecture, + Variant: platform.Variant, + OS: platform.OS, + Created: &created, + Comment: msg, }, RootFS: &image.RootFS{ Type: "layers", diff --git a/daemon/internal/image/cache/cache.go b/daemon/internal/image/cache/cache.go index 9456884d3f..3338c738d9 100644 --- a/daemon/internal/image/cache/cache.go +++ b/daemon/internal/image/cache/cache.go @@ -11,7 +11,6 @@ import ( "github.com/moby/moby/v2/daemon/builder" "github.com/moby/moby/v2/daemon/internal/image" "github.com/moby/moby/v2/daemon/internal/layer" - "github.com/moby/moby/v2/dockerversion" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" ) @@ -141,12 +140,11 @@ func (ic *ImageCache) restoreCachedImage(parent, target *image.Image, cfg *conta restoredImg := image.Image{ V1Image: image.V1Image{ - DockerVersion: dockerversion.Version, - Config: cfg, - Architecture: target.Architecture, - OS: target.OS, - Author: target.Author, - Created: history[len(history)-1].Created, + Config: cfg, + Architecture: target.Architecture, + OS: target.OS, + Author: target.Author, + Created: history[len(history)-1].Created, }, RootFS: rootFS, History: history, diff --git a/daemon/internal/image/image.go b/daemon/internal/image/image.go index e97c845d38..2ad503b86f 100644 --- a/daemon/internal/image/image.go +++ b/daemon/internal/image/image.go @@ -11,7 +11,6 @@ import ( "github.com/moby/moby/api/types/container" "github.com/moby/moby/v2/daemon/internal/layer" - "github.com/moby/moby/v2/dockerversion" "github.com/opencontainers/go-digest" ocispec "github.com/opencontainers/image-spec/specs-go/v1" ) @@ -236,7 +235,6 @@ func NewChildImage(img *Image, child ChildConfig, os string) *Image { return &Image{ V1Image: V1Image{ - DockerVersion: dockerversion.Version, Config: child.Config, Architecture: img.BaseImgArch(), Variant: img.BaseImgVariant(), diff --git a/daemon/pkg/plugin/backend_linux.go b/daemon/pkg/plugin/backend_linux.go index 148a723f1a..75745210f3 100644 --- a/daemon/pkg/plugin/backend_linux.go +++ b/daemon/pkg/plugin/backend_linux.go @@ -32,7 +32,6 @@ import ( "github.com/moby/moby/v2/daemon/internal/stringid" v2 "github.com/moby/moby/v2/daemon/pkg/plugin/v2" "github.com/moby/moby/v2/daemon/server/backend" - "github.com/moby/moby/v2/dockerversion" "github.com/moby/moby/v2/errdefs" "github.com/moby/moby/v2/pkg/authorization" "github.com/moby/moby/v2/pkg/pools" @@ -707,8 +706,6 @@ func (pm *Manager) CreateFromContext(ctx context.Context, tarCtx io.ReadCloser, DiffIds: []string{rootFSBlob.Digest().String()}, } - config.DockerVersion = dockerversion.Version //nolint:staticcheck // ignore SA1019: field is deprecated. - configBlob, err := pm.blobStore.Writer(ctx, content.WithRef(name+"-config.json")) if err != nil { return err