Repository: containers/image
Pull request #721 (2019-10-01 21:33:07)

Correctly use a c/image/v4 module namespace

**\<blink>DO NOT MERGE THIS until this has been proven to work as expected in all consumers\</blink>**


... so that major-version-aware Go module import (as opposed to vX.Y.Z+incompatible, which does not allow different packages to use different versions) works right.


vrothberg: If go down this path, we force all consumers of c/image to use go modules (we had a similar issues with the `mpb` library). It looks good for all projects under our direct influence. All have migrated to go modules and CRI-O v1.14 uses https://github.com/containers/image/tree/cri-o-release-1.14 which is still using the old vendoring model.

I'm supportive of doing the move. Go 1.13 has been released over a month ago and modules are now the defacto standard for dependency management, so it makes sense to me to apply to their rules.
vrothberg: Snap. After catching up on the other PRs and having re-read the go wiki, this PR seems to be the only way forward:

`If the module is version v2 or higher, the major version of the module must be included as a /vN at the end of the module paths used in go.mod files (e.g., module github.com/my/mod/v2, require github.com/my/mod/v2 v2.0.1) and in the package import path (e.g., import "github.com/my/mod/v2/mypkg"). `

The `+incompatible` trick only seems to work for non-module dependencies with version >= v2.0.0.
vrothberg: Opened https://github.com/containers/skopeo/pull/733 to test this PR just to be sure and having exercised the migration to v4 on my own.
rhatdan: LGTM
rhatdan: Do we need to update skopeo for this to get the tests to pass, or do we need to just merge this with the failing tests and then get it vendored into Skopeo?
mtrmac: Yes, we need to update skopeo (per Valentin’s https://github.com/containers/skopeo/pull/733 ), but given how disruptive it is, I’d really prefer to see the _whole stack_ working before merging this.

— and an _explicit_ consensus that we are fine with burdening all consumers with the need to keep updating `image/v`_Number_ . We still have some chance to just revert to a non-module library. (I don’t quite think reverting is the best choice, but it is _an option_ and the downsides with this PR are non-trivial. Once we merge this, going back would be more painful.)
mtrmac: Actually these test failures (`recipe for target 'build' failed`) are local, I’m afraid I must have forgotten to run the local tests on the final result. Fixing…. Still, Skopeo will need updating.

Patch:
diff --git a/Makefile b/Makefile
index 82954d1a..7603fedb 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ BUILD_TAGS_DARWIN_CROSS = containers_image_openpgp
 BUILDTAGS = btrfs_noversion libdm_no_deferred_remove
 BUILDFLAGS := -tags "$(BUILDTAGS)"
 
-PACKAGES := $(shell go list $(BUILDFLAGS) ./... | grep -v github.com/containers/image/vendor)
+PACKAGES := $(shell GO111MODULE=on go list $(BUILDFLAGS) ./...)
 SOURCE_DIRS = $(shell echo $(PACKAGES) | awk 'BEGIN{FS="/"; RS=" "}{print $$4}' | uniq)
 
 PREFIX ?= ${DESTDIR}/usr
@@ -35,7 +35,7 @@ GPGME_ENV = CGO_CFLAGS="$(shell gpgme-config --cflags 2>/dev/null)" CGO_LDFLAGS=
 all: tools test validate .gitvalidation
 
 build:
-	$(GPGME_ENV) GO111MODULE="on" go build $(BUILDFLAGS) $(PACKAGES)
+	$(GPGME_ENV) GO111MODULE="on" go build $(BUILDFLAGS) ./...
 
 $(MANPAGES): %: %.md
 	$(GOMD2MAN) -in $< -out $@
@@ -63,7 +63,7 @@ clean:
 	rm -rf tools.timestamp $(MANPAGES)
 
 test:
-	@$(GPGME_ENV) GO111MODULE="on" go test $(BUILDFLAGS) -cover $(PACKAGES)
+	@$(GPGME_ENV) GO111MODULE="on" go test $(BUILDFLAGS) -cover ./...
 
 # This is not run as part of (make all), but Travis CI does run this.
 # Demonstrating a working version of skopeo (possibly with modified SKOPEO_REPO/SKOPEO_BRANCH, e.g.
@@ -87,11 +87,11 @@ fmt:
 	@gofmt -l -s -w $(SOURCE_DIRS)
 
 validate: lint
-	@GO111MODULE="on" go vet $(PACKAGES)
+	@GO111MODULE="on" go vet ./...
 	@test -z "$$(gofmt -s -l . | grep -ve '^vendor' | tee /dev/stderr)"
 
 lint:
-	@out="$$(golint $(PACKAGES))"; \
+	@out="$$(GO111MODULE="on" golint $(PACKAGES))"; \
 	if [ -n "$$out" ]; then \
 		echo "$$out"; \
 		exit 1; \
diff --git a/copy/copy.go b/copy/copy.go
index 96a93b95..30d8a446 100644
--- a/copy/copy.go
+++ b/copy/copy.go
@@ -13,14 +13,14 @@ import (
 	"sync"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache"
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/signature"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/signature"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/copy/manifest.go b/copy/manifest.go
index e8cc8a9e..7c981fca 100644
--- a/copy/manifest.go
+++ b/copy/manifest.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"strings"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 )
diff --git a/copy/progress_reader.go b/copy/progress_reader.go
index b670ee59..c6a1e3da 100644
--- a/copy/progress_reader.go
+++ b/copy/progress_reader.go
@@ -4,7 +4,7 @@ import (
 	"io"
 	"time"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 )
 
 // progressReader is a reader that reports its progress on an interval.
diff --git a/copy/sign.go b/copy/sign.go
index 91394d2b..64c3b4b2 100644
--- a/copy/sign.go
+++ b/copy/sign.go
@@ -1,8 +1,8 @@
 package copy
 
 import (
-	"github.com/containers/image/signature"
-	"github.com/containers/image/transports"
+	"github.com/containers/image/v4/signature"
+	"github.com/containers/image/v4/transports"
 	"github.com/pkg/errors"
 )
 
diff --git a/directory/directory_dest.go b/directory/directory_dest.go
index 4b2ab022..18f7dde7 100644
--- a/directory/directory_dest.go
+++ b/directory/directory_dest.go
@@ -7,7 +7,7 @@ import (
 	"os"
 	"path/filepath"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/directory/directory_src.go b/directory/directory_src.go
index 59b62539..921c1941 100644
--- a/directory/directory_src.go
+++ b/directory/directory_src.go
@@ -6,8 +6,8 @@ import (
 	"io/ioutil"
 	"os"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/directory/directory_transport.go b/directory/directory_transport.go
index 66b9e725..29ac7115 100644
--- a/directory/directory_transport.go
+++ b/directory/directory_transport.go
@@ -6,11 +6,11 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/containers/image/directory/explicitfilepath"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory/explicitfilepath"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/doc.go b/doc.go
index 0e90fed5..ba0a2149 100644
--- a/doc.go
+++ b/doc.go
@@ -6,7 +6,7 @@
 //   	"context"
 //  	"fmt"
 //
-//  	"github.com/containers/image/docker"
+//  	"github.com/containers/image/v4/docker"
 //  )
 //
 //  func main() {
diff --git a/docker/archive/dest.go b/docker/archive/dest.go
index c88aea3b..9e06e7c9 100644
--- a/docker/archive/dest.go
+++ b/docker/archive/dest.go
@@ -5,8 +5,8 @@ import (
 	"io"
 	"os"
 
-	"github.com/containers/image/docker/tarfile"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/tarfile"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/archive/src.go b/docker/archive/src.go
index e46c9db4..feea0dec 100644
--- a/docker/archive/src.go
+++ b/docker/archive/src.go
@@ -2,8 +2,8 @@ package archive
 
 import (
 	"context"
-	"github.com/containers/image/docker/tarfile"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/tarfile"
+	"github.com/containers/image/v4/types"
 	"github.com/sirupsen/logrus"
 )
 
diff --git a/docker/archive/transport.go b/docker/archive/transport.go
index f345b343..347fdbd6 100644
--- a/docker/archive/transport.go
+++ b/docker/archive/transport.go
@@ -5,10 +5,10 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	ctrImage "github.com/containers/image/image"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	ctrImage "github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/cache.go b/docker/cache.go
index 64ad57a7..51bf5b0d 100644
--- a/docker/cache.go
+++ b/docker/cache.go
@@ -1,8 +1,8 @@
 package docker
 
 import (
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 )
 
 // bicTransportScope returns a BICTransportScope appropriate for ref.
diff --git a/docker/daemon/client.go b/docker/daemon/client.go
index 26f1b03b..94c4970f 100644
--- a/docker/daemon/client.go
+++ b/docker/daemon/client.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 	"path/filepath"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	dockerclient "github.com/docker/docker/client"
 	"github.com/docker/go-connections/tlsconfig"
 )
diff --git a/docker/daemon/daemon_dest.go b/docker/daemon/daemon_dest.go
index 663086ff..2c56ab93 100644
--- a/docker/daemon/daemon_dest.go
+++ b/docker/daemon/daemon_dest.go
@@ -4,9 +4,9 @@ import (
 	"context"
 	"io"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/docker/tarfile"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/docker/tarfile"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/docker/client"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/docker/daemon/daemon_src.go b/docker/daemon/daemon_src.go
index 89e66eff..f6f60aaf 100644
--- a/docker/daemon/daemon_src.go
+++ b/docker/daemon/daemon_src.go
@@ -3,8 +3,8 @@ package daemon
 import (
 	"context"
 
-	"github.com/containers/image/docker/tarfile"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/tarfile"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/daemon/daemon_transport.go b/docker/daemon/daemon_transport.go
index 1a265bf7..4c6986ba 100644
--- a/docker/daemon/daemon_transport.go
+++ b/docker/daemon/daemon_transport.go
@@ -4,11 +4,11 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/containers/image/docker/policyconfiguration"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/policyconfiguration"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/docker/docker_client.go b/docker/docker_client.go
index a7f29b1f..d5662a03 100644
--- a/docker/docker_client.go
+++ b/docker/docker_client.go
@@ -16,11 +16,11 @@ import (
 	"sync"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/pkg/docker/config"
-	"github.com/containers/image/pkg/sysregistriesv2"
-	"github.com/containers/image/pkg/tlsclientconfig"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/pkg/docker/config"
+	"github.com/containers/image/v4/pkg/sysregistriesv2"
+	"github.com/containers/image/v4/pkg/tlsclientconfig"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/distribution/registry/client"
 	"github.com/docker/go-connections/tlsconfig"
 	digest "github.com/opencontainers/go-digest"
diff --git a/docker/docker_image.go b/docker/docker_image.go
index 744667f5..4332dc02 100644
--- a/docker/docker_image.go
+++ b/docker/docker_image.go
@@ -8,9 +8,9 @@ import (
 	"net/url"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/docker_image_dest.go b/docker/docker_image_dest.go
index c116cbec..0f351ab5 100644
--- a/docker/docker_image_dest.go
+++ b/docker/docker_image_dest.go
@@ -14,10 +14,10 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache/none"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache/none"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/distribution/registry/api/errcode"
 	"github.com/docker/distribution/registry/api/v2"
 	"github.com/docker/distribution/registry/client"
diff --git a/docker/docker_image_src.go b/docker/docker_image_src.go
index 6951f31e..353b1a6c 100644
--- a/docker/docker_image_src.go
+++ b/docker/docker_image_src.go
@@ -11,10 +11,10 @@ import (
 	"os"
 	"strconv"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/sysregistriesv2"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/sysregistriesv2"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/distribution/registry/client"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
diff --git a/docker/docker_transport.go b/docker/docker_transport.go
index 45da7c96..c9ce75e0 100644
--- a/docker/docker_transport.go
+++ b/docker/docker_transport.go
@@ -5,10 +5,10 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/containers/image/docker/policyconfiguration"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/policyconfiguration"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/lookaside.go b/docker/lookaside.go
index 860f1ad5..c43160f7 100644
--- a/docker/lookaside.go
+++ b/docker/lookaside.go
@@ -9,8 +9,8 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/ghodss/yaml"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
diff --git a/docker/policyconfiguration/naming.go b/docker/policyconfiguration/naming.go
index 31bbb544..e2ed631c 100644
--- a/docker/policyconfiguration/naming.go
+++ b/docker/policyconfiguration/naming.go
@@ -3,7 +3,7 @@ package policyconfiguration
 import (
 	"strings"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 	"github.com/pkg/errors"
 )
 
diff --git a/docker/tarfile/dest.go b/docker/tarfile/dest.go
index 5f30eddb..aec8404b 100644
--- a/docker/tarfile/dest.go
+++ b/docker/tarfile/dest.go
@@ -12,10 +12,10 @@ import (
 	"path/filepath"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/internal/tmpdir"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/internal/tmpdir"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/docker/tarfile/src.go b/docker/tarfile/src.go
index dd5d78fe..78e4d6f6 100644
--- a/docker/tarfile/src.go
+++ b/docker/tarfile/src.go
@@ -11,10 +11,10 @@ import (
 	"path"
 	"sync"
 
-	"github.com/containers/image/internal/tmpdir"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/internal/tmpdir"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/docker/tarfile/types.go b/docker/tarfile/types.go
index e81d9393..c630f522 100644
--- a/docker/tarfile/types.go
+++ b/docker/tarfile/types.go
@@ -1,7 +1,7 @@
 package tarfile
 
 import (
-	"github.com/containers/image/manifest"
+	"github.com/containers/image/v4/manifest"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/go.mod b/go.mod
index e3cd0190..8260a9b5 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/containers/image
+module github.com/containers/image/v4
 
 go 1.11
 
diff --git a/image/docker_list.go b/image/docker_list.go
index 1f0faa1a..a11cd06b 100644
--- a/image/docker_list.go
+++ b/image/docker_list.go
@@ -6,8 +6,8 @@ import (
 	"fmt"
 	"runtime"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/image/docker_schema1.go b/image/docker_schema1.go
index 28cec7dd..97ebeac0 100644
--- a/image/docker_schema1.go
+++ b/image/docker_schema1.go
@@ -3,9 +3,9 @@ package image
 import (
 	"context"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/image/docker_schema2.go b/image/docker_schema2.go
index dbd17c01..9841bbd4 100644
--- a/image/docker_schema2.go
+++ b/image/docker_schema2.go
@@ -10,10 +10,10 @@ import (
 	"io/ioutil"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache/none"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache/none"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/image/manifest.go b/image/manifest.go
index c5ca5b12..f384d2fb 100644
--- a/image/manifest.go
+++ b/image/manifest.go
@@ -4,9 +4,9 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 )
 
diff --git a/image/memory.go b/image/memory.go
index 0be69eca..255965e1 100644
--- a/image/memory.go
+++ b/image/memory.go
@@ -5,7 +5,7 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 )
 
 // memoryImage is a mostly-implementation of types.Image assembled from data
diff --git a/image/oci.go b/image/oci.go
index 98e6f8af..142b0f28 100644
--- a/image/oci.go
+++ b/image/oci.go
@@ -6,10 +6,10 @@ import (
 	"fmt"
 	"io/ioutil"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache/none"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache/none"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/image/sourced.go b/image/sourced.go
index c8364a14..d2a3e2ee 100644
--- a/image/sourced.go
+++ b/image/sourced.go
@@ -6,7 +6,7 @@ package image
 import (
 	"context"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 )
 
 // imageCloser implements types.ImageCloser, perhaps allowing simple users
diff --git a/image/unparsed.go b/image/unparsed.go
index 2c9280d3..d7310765 100644
--- a/image/unparsed.go
+++ b/image/unparsed.go
@@ -3,9 +3,9 @@ package image
 import (
 	"context"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 )
diff --git a/manifest/docker_schema1.go b/manifest/docker_schema1.go
index b76286b8..3c172504 100644
--- a/manifest/docker_schema1.go
+++ b/manifest/docker_schema1.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/docker/api/types/versions"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
diff --git a/manifest/docker_schema2.go b/manifest/docker_schema2.go
index 636698b8..84b189c8 100644
--- a/manifest/docker_schema2.go
+++ b/manifest/docker_schema2.go
@@ -5,9 +5,9 @@ import (
 	"fmt"
 	"time"
 
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/pkg/strslice"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/pkg/strslice"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/manifest/manifest.go b/manifest/manifest.go
index b4f1e284..32af97ea 100644
--- a/manifest/manifest.go
+++ b/manifest/manifest.go
@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"fmt"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/libtrust"
 	digest "github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
diff --git a/manifest/oci.go b/manifest/oci.go
index 1da41121..e483bbb1 100644
--- a/manifest/oci.go
+++ b/manifest/oci.go
@@ -4,8 +4,8 @@ import (
 	"encoding/json"
 	"fmt"
 
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/opencontainers/image-spec/specs-go"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
diff --git a/oci/archive/oci_dest.go b/oci/archive/oci_dest.go
index 9571c37e..2455ed57 100644
--- a/oci/archive/oci_dest.go
+++ b/oci/archive/oci_dest.go
@@ -5,7 +5,7 @@ import (
 	"io"
 	"os"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage/pkg/archive"
 	"github.com/pkg/errors"
 )
diff --git a/oci/archive/oci_src.go b/oci/archive/oci_src.go
index ca74f950..8a479883 100644
--- a/oci/archive/oci_src.go
+++ b/oci/archive/oci_src.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"io"
 
-	ocilayout "github.com/containers/image/oci/layout"
-	"github.com/containers/image/types"
+	ocilayout "github.com/containers/image/v4/oci/layout"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/oci/archive/oci_transport.go b/oci/archive/oci_transport.go
index 7c1d26ba..c8808ecb 100644
--- a/oci/archive/oci_transport.go
+++ b/oci/archive/oci_transport.go
@@ -7,14 +7,14 @@ import (
 	"os"
 	"strings"
 
-	"github.com/containers/image/directory/explicitfilepath"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/internal/tmpdir"
-	"github.com/containers/image/oci/internal"
-	ocilayout "github.com/containers/image/oci/layout"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory/explicitfilepath"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/internal/tmpdir"
+	"github.com/containers/image/v4/oci/internal"
+	ocilayout "github.com/containers/image/v4/oci/layout"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage/pkg/archive"
 	"github.com/pkg/errors"
 )
diff --git a/oci/layout/oci_dest.go b/oci/layout/oci_dest.go
index db102184..20925d3d 100644
--- a/oci/layout/oci_dest.go
+++ b/oci/layout/oci_dest.go
@@ -9,8 +9,8 @@ import (
 	"path/filepath"
 	"runtime"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	imgspec "github.com/opencontainers/image-spec/specs-go"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
diff --git a/oci/layout/oci_src.go b/oci/layout/oci_src.go
index cc536f69..dd6c6c4a 100644
--- a/oci/layout/oci_src.go
+++ b/oci/layout/oci_src.go
@@ -8,8 +8,8 @@ import (
 	"os"
 	"strconv"
 
-	"github.com/containers/image/pkg/tlsclientconfig"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/tlsclientconfig"
+	"github.com/containers/image/v4/types"
 	"github.com/docker/go-connections/tlsconfig"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
diff --git a/oci/layout/oci_transport.go b/oci/layout/oci_transport.go
index 4e5cecff..259852b4 100644
--- a/oci/layout/oci_transport.go
+++ b/oci/layout/oci_transport.go
@@ -8,12 +8,12 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/containers/image/directory/explicitfilepath"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/oci/internal"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory/explicitfilepath"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/oci/internal"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/openshift/openshift.go b/openshift/openshift.go
index 814c3eea..51fff626 100644
--- a/openshift/openshift.go
+++ b/openshift/openshift.go
@@ -12,11 +12,11 @@ import (
 	"net/url"
 	"strings"
 
-	"github.com/containers/image/docker"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
-	"github.com/containers/image/version"
+	"github.com/containers/image/v4/docker"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
+	"github.com/containers/image/v4/version"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/openshift/openshift_transport.go b/openshift/openshift_transport.go
index b27867a0..f00c9456 100644
--- a/openshift/openshift_transport.go
+++ b/openshift/openshift_transport.go
@@ -6,11 +6,11 @@ import (
 	"regexp"
 	"strings"
 
-	"github.com/containers/image/docker/policyconfiguration"
-	"github.com/containers/image/docker/reference"
-	genericImage "github.com/containers/image/image"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/policyconfiguration"
+	"github.com/containers/image/v4/docker/reference"
+	genericImage "github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/ostree/ostree_dest.go b/ostree/ostree_dest.go
index 06a905ae..9e1436e2 100644
--- a/ostree/ostree_dest.go
+++ b/ostree/ostree_dest.go
@@ -20,8 +20,8 @@ import (
 	"time"
 	"unsafe"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage/pkg/archive"
 	"github.com/klauspost/pgzip"
 	"github.com/opencontainers/go-digest"
diff --git a/ostree/ostree_src.go b/ostree/ostree_src.go
index 43d8f683..ecb6e3f8 100644
--- a/ostree/ostree_src.go
+++ b/ostree/ostree_src.go
@@ -13,8 +13,8 @@ import (
 	"strings"
 	"unsafe"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage/pkg/ioutils"
 	"github.com/klauspost/pgzip"
 	digest "github.com/opencontainers/go-digest"
diff --git a/ostree/ostree_transport.go b/ostree/ostree_transport.go
index 2e86623a..d720cb7a 100644
--- a/ostree/ostree_transport.go
+++ b/ostree/ostree_transport.go
@@ -11,11 +11,11 @@ import (
 	"regexp"
 	"strings"
 
-	"github.com/containers/image/directory/explicitfilepath"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory/explicitfilepath"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/pkg/blobinfocache/boltdb/boltdb.go b/pkg/blobinfocache/boltdb/boltdb.go
index 19d0a6c8..85eb7d6f 100644
--- a/pkg/blobinfocache/boltdb/boltdb.go
+++ b/pkg/blobinfocache/boltdb/boltdb.go
@@ -7,8 +7,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/containers/image/pkg/blobinfocache/internal/prioritize"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/internal/prioritize"
+	"github.com/containers/image/v4/types"
 	bolt "github.com/etcd-io/bbolt"
 	"github.com/opencontainers/go-digest"
 	"github.com/sirupsen/logrus"
diff --git a/pkg/blobinfocache/default.go b/pkg/blobinfocache/default.go
index 35733321..af136c36 100644
--- a/pkg/blobinfocache/default.go
+++ b/pkg/blobinfocache/default.go
@@ -6,9 +6,9 @@ import (
 	"path/filepath"
 	"strconv"
 
-	"github.com/containers/image/pkg/blobinfocache/boltdb"
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/boltdb"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	"github.com/sirupsen/logrus"
 )
 
diff --git a/pkg/blobinfocache/internal/prioritize/prioritize.go b/pkg/blobinfocache/internal/prioritize/prioritize.go
index 5479319d..7820119b 100644
--- a/pkg/blobinfocache/internal/prioritize/prioritize.go
+++ b/pkg/blobinfocache/internal/prioritize/prioritize.go
@@ -6,7 +6,7 @@ import (
 	"sort"
 	"time"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/pkg/blobinfocache/memory/memory.go b/pkg/blobinfocache/memory/memory.go
index dfb33863..c51b9f5c 100644
--- a/pkg/blobinfocache/memory/memory.go
+++ b/pkg/blobinfocache/memory/memory.go
@@ -5,8 +5,8 @@ import (
 	"sync"
 	"time"
 
-	"github.com/containers/image/pkg/blobinfocache/internal/prioritize"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/internal/prioritize"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/sirupsen/logrus"
 )
diff --git a/pkg/blobinfocache/none/none.go b/pkg/blobinfocache/none/none.go
index e5dca25c..c5ce29a4 100644
--- a/pkg/blobinfocache/none/none.go
+++ b/pkg/blobinfocache/none/none.go
@@ -2,7 +2,7 @@
 package none
 
 import (
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/pkg/compression/compression.go b/pkg/compression/compression.go
index f0c4febb..fd2f2154 100644
--- a/pkg/compression/compression.go
+++ b/pkg/compression/compression.go
@@ -7,8 +7,8 @@ import (
 	"io"
 	"io/ioutil"
 
-	"github.com/containers/image/pkg/compression/internal"
-	"github.com/containers/image/pkg/compression/types"
+	"github.com/containers/image/v4/pkg/compression/internal"
+	"github.com/containers/image/v4/pkg/compression/types"
 	"github.com/klauspost/pgzip"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/pkg/compression/types/types.go b/pkg/compression/types/types.go
index 613342b4..ea43dc8c 100644
--- a/pkg/compression/types/types.go
+++ b/pkg/compression/types/types.go
@@ -1,7 +1,7 @@
 package types
 
 import (
-	"github.com/containers/image/pkg/compression/internal"
+	"github.com/containers/image/v4/pkg/compression/internal"
 )
 
 // DecompressorFunc returns the decompressed stream, given a compressed stream.
diff --git a/pkg/docker/config/config.go b/pkg/docker/config/config.go
index 5ab6ba64..e720dc86 100644
--- a/pkg/docker/config/config.go
+++ b/pkg/docker/config/config.go
@@ -9,7 +9,7 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	helperclient "github.com/docker/docker-credential-helpers/client"
 	"github.com/docker/docker-credential-helpers/credentials"
 	"github.com/docker/docker/pkg/homedir"
diff --git a/pkg/docker/config/config_linux.go b/pkg/docker/config/config_linux.go
index 7a49b6cb..0cd73528 100644
--- a/pkg/docker/config/config_linux.go
+++ b/pkg/docker/config/config_linux.go
@@ -4,7 +4,7 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/containers/image/internal/pkg/keyctl"
+	"github.com/containers/image/v4/internal/pkg/keyctl"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 )
diff --git a/pkg/sysregistriesv2/system_registries_v2.go b/pkg/sysregistriesv2/system_registries_v2.go
index bed92cb9..0cd60778 100644
--- a/pkg/sysregistriesv2/system_registries_v2.go
+++ b/pkg/sysregistriesv2/system_registries_v2.go
@@ -10,11 +10,11 @@ import (
 	"sync"
 
 	"github.com/BurntSushi/toml"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 )
 
 // systemRegistriesConfPath is the path to the system-wide registry
diff --git a/signature/docker.go b/signature/docker.go
index 16eb3f79..c3ac33d4 100644
--- a/signature/docker.go
+++ b/signature/docker.go
@@ -5,8 +5,8 @@ package signature
 import (
 	"fmt"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/signature/policy_config.go b/signature/policy_config.go
index 12398e38..bb229f5f 100644
--- a/signature/policy_config.go
+++ b/signature/policy_config.go
@@ -19,9 +19,9 @@ import (
 	"io/ioutil"
 	"path/filepath"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/signature/policy_eval.go b/signature/policy_eval.go
index b66ece41..110d40f7 100644
--- a/signature/policy_eval.go
+++ b/signature/policy_eval.go
@@ -8,7 +8,7 @@ package signature
 import (
 	"context"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
 )
diff --git a/signature/policy_eval_baselayer.go b/signature/policy_eval_baselayer.go
index 54c6dc12..18fb651d 100644
--- a/signature/policy_eval_baselayer.go
+++ b/signature/policy_eval_baselayer.go
@@ -5,7 +5,7 @@ package signature
 import (
 	"context"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/sirupsen/logrus"
 )
 
diff --git a/signature/policy_eval_signedby.go b/signature/policy_eval_signedby.go
index d59ffa18..b8188da5 100644
--- a/signature/policy_eval_signedby.go
+++ b/signature/policy_eval_signedby.go
@@ -10,8 +10,8 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/signature/policy_eval_simple.go b/signature/policy_eval_simple.go
index b0f2fff2..7fbcf4a9 100644
--- a/signature/policy_eval_simple.go
+++ b/signature/policy_eval_simple.go
@@ -6,8 +6,8 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 )
 
 func (pr *prInsecureAcceptAnything) isSignatureAuthorAccepted(ctx context.Context, image types.UnparsedImage, sig []byte) (signatureAcceptanceResult, *Signature, error) {
diff --git a/signature/policy_reference_match.go b/signature/policy_reference_match.go
index a8dad677..016d737f 100644
--- a/signature/policy_reference_match.go
+++ b/signature/policy_reference_match.go
@@ -5,9 +5,9 @@ package signature
 import (
 	"fmt"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 )
 
 // parseImageAndDockerReference converts an image and a reference string into two parsed entities, failing on any error and handling unidentified images.
diff --git a/signature/signature.go b/signature/signature.go
index 41f13f72..09c4de0b 100644
--- a/signature/signature.go
+++ b/signature/signature.go
@@ -11,7 +11,7 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/containers/image/version"
+	"github.com/containers/image/v4/version"
 	"github.com/opencontainers/go-digest"
 )
 
diff --git a/storage/storage_image.go b/storage/storage_image.go
index 7d8860a5..4e913b84 100644
--- a/storage/storage_image.go
+++ b/storage/storage_image.go
@@ -14,12 +14,12 @@ import (
 	"sync"
 	"sync/atomic"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/internal/tmpdir"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache/none"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/internal/tmpdir"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache/none"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage"
 	"github.com/containers/storage/pkg/archive"
 	"github.com/containers/storage/pkg/ioutils"
diff --git a/storage/storage_reference.go b/storage/storage_reference.go
index c046d9f2..7ad20817 100644
--- a/storage/storage_reference.go
+++ b/storage/storage_reference.go
@@ -6,8 +6,8 @@ import (
 	"context"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage"
 	"github.com/pkg/errors"
 	"github.com/sirupsen/logrus"
diff --git a/storage/storage_transport.go b/storage/storage_transport.go
index c9a05e6c..48b909c0 100644
--- a/storage/storage_transport.go
+++ b/storage/storage_transport.go
@@ -9,9 +9,9 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage"
 	"github.com/containers/storage/pkg/idtools"
 	digest "github.com/opencontainers/go-digest"
diff --git a/tarball/doc.go b/tarball/doc.go
index a6ced5a0..ebbe156b 100644
--- a/tarball/doc.go
+++ b/tarball/doc.go
@@ -7,11 +7,11 @@
 //	import (
 //		"fmt"
 //
-//		cp "github.com/containers/image/copy"
-//		"github.com/containers/image/tarball"
-//		"github.com/containers/image/transports/alltransports"
+//		cp "github.com/containers/image/v4/copy"
+//		"github.com/containers/image/v4/tarball"
+//		"github.com/containers/image/v4/transports/alltransports"
 //
-//		imgspecv1 "github.com/containers/image/transports/alltransports"
+//		imgspecv1 "github.com/containers/image/v4/transports/alltransports"
 //	)
 //
 //	func imageFromTarball() {
diff --git a/tarball/tarball_reference.go b/tarball/tarball_reference.go
index fc1230a8..d33c20de 100644
--- a/tarball/tarball_reference.go
+++ b/tarball/tarball_reference.go
@@ -6,9 +6,9 @@ import (
 	"os"
 	"strings"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/types"
 
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 )
diff --git a/tarball/tarball_src.go b/tarball/tarball_src.go
index 76e3e755..ead1a50b 100644
--- a/tarball/tarball_src.go
+++ b/tarball/tarball_src.go
@@ -12,7 +12,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/klauspost/pgzip"
 	digest "github.com/opencontainers/go-digest"
 	imgspecs "github.com/opencontainers/image-spec/specs-go"
diff --git a/tarball/tarball_transport.go b/tarball/tarball_transport.go
index 72558b5e..84874cfb 100644
--- a/tarball/tarball_transport.go
+++ b/tarball/tarball_transport.go
@@ -7,8 +7,8 @@ import (
 	"os"
 	"strings"
 
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 )
 
 const (
diff --git a/transports/alltransports/alltransports.go b/transports/alltransports/alltransports.go
index 3a988f3f..ae68fb8e 100644
--- a/transports/alltransports/alltransports.go
+++ b/transports/alltransports/alltransports.go
@@ -6,17 +6,17 @@ import (
 	// register all known transports
 	// NOTE: Make sure docs/containers-policy.json.5.md is updated when adding or updating
 	// a transport.
-	_ "github.com/containers/image/directory"
-	_ "github.com/containers/image/docker"
-	_ "github.com/containers/image/docker/archive"
-	_ "github.com/containers/image/oci/archive"
-	_ "github.com/containers/image/oci/layout"
-	_ "github.com/containers/image/openshift"
-	_ "github.com/containers/image/tarball"
+	_ "github.com/containers/image/v4/directory"
+	_ "github.com/containers/image/v4/docker"
+	_ "github.com/containers/image/v4/docker/archive"
+	_ "github.com/containers/image/v4/oci/archive"
+	_ "github.com/containers/image/v4/oci/layout"
+	_ "github.com/containers/image/v4/openshift"
+	_ "github.com/containers/image/v4/tarball"
 	// The ostree transport is registered by ostree*.go
 	// The storage transport is registered by storage*.go
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 )
 
diff --git a/transports/alltransports/docker_daemon.go b/transports/alltransports/docker_daemon.go
index 6d2ba4b3..d3fc18b2 100644
--- a/transports/alltransports/docker_daemon.go
+++ b/transports/alltransports/docker_daemon.go
@@ -4,5 +4,5 @@ package alltransports
 
 import (
 	// Register the docker-daemon transport
-	_ "github.com/containers/image/docker/daemon"
+	_ "github.com/containers/image/v4/docker/daemon"
 )
diff --git a/transports/alltransports/docker_daemon_stub.go b/transports/alltransports/docker_daemon_stub.go
index 27f3850f..82e05537 100644
--- a/transports/alltransports/docker_daemon_stub.go
+++ b/transports/alltransports/docker_daemon_stub.go
@@ -2,7 +2,7 @@
 
 package alltransports
 
-import "github.com/containers/image/transports"
+import "github.com/containers/image/v4/transports"
 
 func init() {
 	transports.Register(transports.NewStubTransport("docker-daemon"))
diff --git a/transports/alltransports/ostree.go b/transports/alltransports/ostree.go
index cc4d69fe..89169661 100644
--- a/transports/alltransports/ostree.go
+++ b/transports/alltransports/ostree.go
@@ -4,5 +4,5 @@ package alltransports
 
 import (
 	// Register the ostree transport
-	_ "github.com/containers/image/ostree"
+	_ "github.com/containers/image/v4/ostree"
 )
diff --git a/transports/alltransports/ostree_stub.go b/transports/alltransports/ostree_stub.go
index fb5b96e5..892518d5 100644
--- a/transports/alltransports/ostree_stub.go
+++ b/transports/alltransports/ostree_stub.go
@@ -2,7 +2,7 @@
 
 package alltransports
 
-import "github.com/containers/image/transports"
+import "github.com/containers/image/v4/transports"
 
 func init() {
 	transports.Register(transports.NewStubTransport("ostree"))
diff --git a/transports/alltransports/storage.go b/transports/alltransports/storage.go
index a867c664..96f3e17f 100644
--- a/transports/alltransports/storage.go
+++ b/transports/alltransports/storage.go
@@ -4,5 +4,5 @@ package alltransports
 
 import (
 	// Register the storage transport
-	_ "github.com/containers/image/storage"
+	_ "github.com/containers/image/v4/storage"
 )
diff --git a/transports/alltransports/storage_stub.go b/transports/alltransports/storage_stub.go
index 4ac684e5..14c94211 100644
--- a/transports/alltransports/storage_stub.go
+++ b/transports/alltransports/storage_stub.go
@@ -2,7 +2,7 @@
 
 package alltransports
 
-import "github.com/containers/image/transports"
+import "github.com/containers/image/v4/transports"
 
 func init() {
 	transports.Register(transports.NewStubTransport("containers-storage"))
diff --git a/transports/stub.go b/transports/stub.go
index 087f69b6..e3ee6203 100644
--- a/transports/stub.go
+++ b/transports/stub.go
@@ -3,7 +3,7 @@ package transports
 import (
 	"fmt"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 )
 
 // stubTransport is an implementation of types.ImageTransport which has a name, but rejects any references with “the transport $name: is not supported in this build”.
diff --git a/transports/transports.go b/transports/transports.go
index 687d0a44..8bdb46b4 100644
--- a/transports/transports.go
+++ b/transports/transports.go
@@ -5,7 +5,7 @@ import (
 	"sort"
 	"sync"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 )
 
 // knownTransports is a registry of known ImageTransport instances.
diff --git a/types/types.go b/types/types.go
index d9486d5c..af11a2b2 100644
--- a/types/types.go
+++ b/types/types.go
@@ -5,8 +5,8 @@ import (
 	"io"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	compression "github.com/containers/image/pkg/compression/types"
+	"github.com/containers/image/v4/docker/reference"
+	compression "github.com/containers/image/v4/pkg/compression/types"
 	digest "github.com/opencontainers/go-digest"
 	v1 "github.com/opencontainers/image-spec/specs-go/v1"
 )


Test patch:
diff --git a/copy/copy_test.go b/copy/copy_test.go
index 49f2d109..3386962c 100644
--- a/copy/copy_test.go
+++ b/copy/copy_test.go
@@ -9,7 +9,7 @@ import (
 
 	"github.com/pkg/errors"
 
-	"github.com/containers/image/pkg/compression"
+	"github.com/containers/image/v4/pkg/compression"
 	"github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/copy/manifest_test.go b/copy/manifest_test.go
index 0683a73f..c8d25b91 100644
--- a/copy/manifest_test.go
+++ b/copy/manifest_test.go
@@ -6,9 +6,9 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/copy/sign_test.go b/copy/sign_test.go
index 936f683c..f414746a 100644
--- a/copy/sign_test.go
+++ b/copy/sign_test.go
@@ -6,11 +6,11 @@ import (
 	"os"
 	"testing"
 
-	"github.com/containers/image/directory"
-	"github.com/containers/image/docker"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/signature"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory"
+	"github.com/containers/image/v4/docker"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/signature"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/directory/directory_test.go b/directory/directory_test.go
index 121b1cf9..65f33026 100644
--- a/directory/directory_test.go
+++ b/directory/directory_test.go
@@ -7,9 +7,9 @@ import (
 	"os"
 	"testing"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/stretchr/testify/assert"
diff --git a/directory/directory_transport_test.go b/directory/directory_transport_test.go
index 7898cc6d..1fbe6ca8 100644
--- a/directory/directory_transport_test.go
+++ b/directory/directory_transport_test.go
@@ -7,8 +7,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	_ "github.com/containers/image/internal/testing/explicitfilepath-tmpdir"
-	"github.com/containers/image/types"
+	_ "github.com/containers/image/v4/internal/testing/explicitfilepath-tmpdir"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/directory/explicitfilepath/path_test.go b/directory/explicitfilepath/path_test.go
index 4d268878..15a03fe2 100644
--- a/directory/explicitfilepath/path_test.go
+++ b/directory/explicitfilepath/path_test.go
@@ -7,7 +7,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	_ "github.com/containers/image/internal/testing/explicitfilepath-tmpdir"
+	_ "github.com/containers/image/v4/internal/testing/explicitfilepath-tmpdir"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/docker/archive/transport_test.go b/docker/archive/transport_test.go
index ce17d6fc..2e62f42b 100644
--- a/docker/archive/transport_test.go
+++ b/docker/archive/transport_test.go
@@ -8,8 +8,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/docker/daemon/client_test.go b/docker/daemon/client_test.go
index 9c662e53..7285482b 100644
--- a/docker/daemon/client_test.go
+++ b/docker/daemon/client_test.go
@@ -2,7 +2,7 @@ package daemon
 
 import "testing"
 import (
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	dockerclient "github.com/docker/docker/client"
 	"github.com/stretchr/testify/assert"
 	"net/http"
diff --git a/docker/daemon/daemon_transport_test.go b/docker/daemon/daemon_transport_test.go
index 4a39b2af..ef96b42f 100644
--- a/docker/daemon/daemon_transport_test.go
+++ b/docker/daemon/daemon_transport_test.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/docker/docker_client_test.go b/docker/docker_client_test.go
index 045c3380..94330846 100644
--- a/docker/docker_client_test.go
+++ b/docker/docker_client_test.go
@@ -8,7 +8,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/docker/docker_transport_test.go b/docker/docker_transport_test.go
index a9b30230..8aa3794a 100644
--- a/docker/docker_transport_test.go
+++ b/docker/docker_transport_test.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/docker/lookaside_test.go b/docker/lookaside_test.go
index b15d8f22..ff0a5442 100644
--- a/docker/lookaside_test.go
+++ b/docker/lookaside_test.go
@@ -8,7 +8,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/docker/policyconfiguration/naming_test.go b/docker/policyconfiguration/naming_test.go
index 5998faa8..075488c9 100644
--- a/docker/policyconfiguration/naming_test.go
+++ b/docker/policyconfiguration/naming_test.go
@@ -5,7 +5,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/image/docker_list_test.go b/image/docker_list_test.go
index c54e5f09..6bfbae71 100644
--- a/image/docker_list_test.go
+++ b/image/docker_list_test.go
@@ -6,7 +6,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/image/docker_schema1_test.go b/image/docker_schema1_test.go
index 4d6754ce..56762c85 100644
--- a/image/docker_schema1_test.go
+++ b/image/docker_schema1_test.go
@@ -8,9 +8,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/stretchr/testify/assert"
diff --git a/image/docker_schema2_test.go b/image/docker_schema2_test.go
index 458711e1..8a901cbd 100644
--- a/image/docker_schema2_test.go
+++ b/image/docker_schema2_test.go
@@ -10,9 +10,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/image/manifest_test.go b/image/manifest_test.go
index 06001367..938c88d0 100644
--- a/image/manifest_test.go
+++ b/image/manifest_test.go
@@ -3,8 +3,8 @@ package image
 import (
 	"testing"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/image/oci_test.go b/image/oci_test.go
index 13969a3e..37f2bfa9 100644
--- a/image/oci_test.go
+++ b/image/oci_test.go
@@ -10,9 +10,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/pkg/errors"
diff --git a/internal/testing/mocks/imagetransport.go b/internal/testing/mocks/imagetransport.go
index 27c11f5e..9304649b 100644
--- a/internal/testing/mocks/imagetransport.go
+++ b/internal/testing/mocks/imagetransport.go
@@ -1,6 +1,6 @@
 package mocks
 
-import "github.com/containers/image/types"
+import "github.com/containers/image/v4/types"
 
 // NameImageTransport is a mock of types.ImageTransport which returns itself in Name.
 type NameImageTransport string
diff --git a/manifest/docker_schema1_test.go b/manifest/docker_schema1_test.go
index f9f99e8d..aea26f1b 100644
--- a/manifest/docker_schema1_test.go
+++ b/manifest/docker_schema1_test.go
@@ -6,7 +6,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/manifest/docker_schema2_test.go b/manifest/docker_schema2_test.go
index e0a9d30e..9774e684 100644
--- a/manifest/docker_schema2_test.go
+++ b/manifest/docker_schema2_test.go
@@ -4,8 +4,8 @@ import (
 	"io/ioutil"
 	"testing"
 
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/manifest/manifest_test.go b/manifest/manifest_test.go
index d4f75a78..7ed9e042 100644
--- a/manifest/manifest_test.go
+++ b/manifest/manifest_test.go
@@ -5,7 +5,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/libtrust"
 	digest "github.com/opencontainers/go-digest"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
diff --git a/manifest/oci_test.go b/manifest/oci_test.go
index 6469fdf4..13ea86b2 100644
--- a/manifest/oci_test.go
+++ b/manifest/oci_test.go
@@ -4,8 +4,8 @@ import (
 	"io/ioutil"
 	"testing"
 
-	"github.com/containers/image/pkg/compression"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/compression"
+	"github.com/containers/image/v4/types"
 	imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
 	"github.com/stretchr/testify/assert"
 )
diff --git a/oci/archive/oci_transport_test.go b/oci/archive/oci_transport_test.go
index b87b0d3d..e9a0dc5f 100644
--- a/oci/archive/oci_transport_test.go
+++ b/oci/archive/oci_transport_test.go
@@ -7,8 +7,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	_ "github.com/containers/image/internal/testing/explicitfilepath-tmpdir"
-	"github.com/containers/image/types"
+	_ "github.com/containers/image/v4/internal/testing/explicitfilepath-tmpdir"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/oci/layout/oci_dest_test.go b/oci/layout/oci_dest_test.go
index 44316fab..edc510b3 100644
--- a/oci/layout/oci_dest_test.go
+++ b/oci/layout/oci_dest_test.go
@@ -6,8 +6,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	"github.com/pkg/errors"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/oci/layout/oci_src_test.go b/oci/layout/oci_src_test.go
index a87fc1b1..a3ef0dce 100644
--- a/oci/layout/oci_src_test.go
+++ b/oci/layout/oci_src_test.go
@@ -12,8 +12,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/oci/layout/oci_transport_test.go b/oci/layout/oci_transport_test.go
index 90fcbc62..7c99e989 100644
--- a/oci/layout/oci_transport_test.go
+++ b/oci/layout/oci_transport_test.go
@@ -7,8 +7,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	_ "github.com/containers/image/internal/testing/explicitfilepath-tmpdir"
-	"github.com/containers/image/types"
+	_ "github.com/containers/image/v4/internal/testing/explicitfilepath-tmpdir"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/openshift/openshift_transport_test.go b/openshift/openshift_transport_test.go
index 3459a39a..43534ce1 100644
--- a/openshift/openshift_transport_test.go
+++ b/openshift/openshift_transport_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/ostree/ostree_transport_test.go b/ostree/ostree_transport_test.go
index 51621245..3a68a768 100644
--- a/ostree/ostree_transport_test.go
+++ b/ostree/ostree_transport_test.go
@@ -11,8 +11,8 @@ import (
 	"strings"
 	"testing"
 
-	_ "github.com/containers/image/internal/testing/explicitfilepath-tmpdir"
-	"github.com/containers/image/types"
+	_ "github.com/containers/image/v4/internal/testing/explicitfilepath-tmpdir"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/pkg/blobinfocache/boltdb/boltdb_test.go b/pkg/blobinfocache/boltdb/boltdb_test.go
index 3b75511f..1ec4e0df 100644
--- a/pkg/blobinfocache/boltdb/boltdb_test.go
+++ b/pkg/blobinfocache/boltdb/boltdb_test.go
@@ -6,8 +6,8 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/pkg/blobinfocache/internal/test"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/internal/test"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/pkg/blobinfocache/default_test.go b/pkg/blobinfocache/default_test.go
index f0e46675..97f31fe9 100644
--- a/pkg/blobinfocache/default_test.go
+++ b/pkg/blobinfocache/default_test.go
@@ -9,9 +9,9 @@ import (
 	"github.com/sirupsen/logrus"
 	"github.com/stretchr/testify/require"
 
-	"github.com/containers/image/pkg/blobinfocache/boltdb"
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/boltdb"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/pkg/blobinfocache/internal/prioritize/prioritize_test.go b/pkg/blobinfocache/internal/prioritize/prioritize_test.go
index bd6365d9..22372ae3 100644
--- a/pkg/blobinfocache/internal/prioritize/prioritize_test.go
+++ b/pkg/blobinfocache/internal/prioritize/prioritize_test.go
@@ -5,7 +5,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 )
diff --git a/pkg/blobinfocache/internal/test/test.go b/pkg/blobinfocache/internal/test/test.go
index 977f9860..a4f8499c 100644
--- a/pkg/blobinfocache/internal/test/test.go
+++ b/pkg/blobinfocache/internal/test/test.go
@@ -4,9 +4,9 @@ package test
 import (
 	"testing"
 
-	"github.com/containers/image/internal/testing/mocks"
+	"github.com/containers/image/v4/internal/testing/mocks"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	digest "github.com/opencontainers/go-digest"
 	"github.com/stretchr/testify/assert"
 )
diff --git a/pkg/blobinfocache/memory/memory_test.go b/pkg/blobinfocache/memory/memory_test.go
index d65ca447..18476f40 100644
--- a/pkg/blobinfocache/memory/memory_test.go
+++ b/pkg/blobinfocache/memory/memory_test.go
@@ -3,8 +3,8 @@ package memory
 import (
 	"testing"
 
-	"github.com/containers/image/pkg/blobinfocache/internal/test"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/internal/test"
+	"github.com/containers/image/v4/types"
 )
 
 func newTestCache(t *testing.T) (types.BlobInfoCache, func(t *testing.T)) {
diff --git a/pkg/docker/config/config_test.go b/pkg/docker/config/config_test.go
index 4014a615..4491c61b 100644
--- a/pkg/docker/config/config_test.go
+++ b/pkg/docker/config/config_test.go
@@ -8,7 +8,7 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage/pkg/homedir"
 	"github.com/pkg/errors"
 	"github.com/stretchr/testify/assert"
diff --git a/pkg/sysregistriesv2/system_registries_v2_test.go b/pkg/sysregistriesv2/system_registries_v2_test.go
index 40ee6695..e311f39b 100644
--- a/pkg/sysregistriesv2/system_registries_v2_test.go
+++ b/pkg/sysregistriesv2/system_registries_v2_test.go
@@ -7,11 +7,11 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 )
 
 func TestParseLocation(t *testing.T) {
diff --git a/signature/policy_config_test.go b/signature/policy_config_test.go
index b3d0fb6d..75e29187 100644
--- a/signature/policy_config_test.go
+++ b/signature/policy_config_test.go
@@ -7,12 +7,12 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/containers/image/directory"
-	"github.com/containers/image/docker"
+	"github.com/containers/image/v4/directory"
+	"github.com/containers/image/v4/docker"
 	"github.com/pkg/errors"
 	// this import is needed  where we use the "atomic" transport in TestPolicyUnmarshalJSON
-	_ "github.com/containers/image/openshift"
-	"github.com/containers/image/types"
+	_ "github.com/containers/image/v4/openshift"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/signature/policy_eval_signedby_test.go b/signature/policy_eval_signedby_test.go
index 06109bf2..827d8afe 100644
--- a/signature/policy_eval_signedby_test.go
+++ b/signature/policy_eval_signedby_test.go
@@ -7,10 +7,10 @@ import (
 	"path"
 	"testing"
 
-	"github.com/containers/image/directory"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/image"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/directory"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/image"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/signature/policy_eval_simple_test.go b/signature/policy_eval_simple_test.go
index 78db959b..d7d77ddd 100644
--- a/signature/policy_eval_simple_test.go
+++ b/signature/policy_eval_simple_test.go
@@ -4,9 +4,9 @@ import (
 	"context"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/internal/testing/mocks"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/internal/testing/mocks"
+	"github.com/containers/image/v4/types"
 )
 
 // nameOnlyImageMock is a mock of types.UnparsedImage which only allows transports.ImageName to work
diff --git a/signature/policy_eval_test.go b/signature/policy_eval_test.go
index a9808ad4..1fff2ede 100644
--- a/signature/policy_eval_test.go
+++ b/signature/policy_eval_test.go
@@ -6,12 +6,12 @@ import (
 	"os"
 	"testing"
 
-	"github.com/containers/image/docker"
-	"github.com/containers/image/docker/policyconfiguration"
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/internal/testing/mocks"
-	"github.com/containers/image/transports"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker"
+	"github.com/containers/image/v4/docker/policyconfiguration"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/internal/testing/mocks"
+	"github.com/containers/image/v4/transports"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/signature/policy_reference_match_test.go b/signature/policy_reference_match_test.go
index 66ac28eb..71e4e5f4 100644
--- a/signature/policy_reference_match_test.go
+++ b/signature/policy_reference_match_test.go
@@ -5,9 +5,9 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
-	"github.com/containers/image/internal/testing/mocks"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/docker/reference"
+	"github.com/containers/image/v4/internal/testing/mocks"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/signature/signature_test.go b/signature/signature_test.go
index 412a03df..c79e2873 100644
--- a/signature/signature_test.go
+++ b/signature/signature_test.go
@@ -7,7 +7,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/version"
+	"github.com/containers/image/v4/version"
 	"github.com/opencontainers/go-digest"
 	"github.com/pkg/errors"
 	"github.com/stretchr/testify/assert"
diff --git a/storage/storage_image_test.go b/storage/storage_image_test.go
index b15533e3..8064694f 100644
--- a/storage/storage_image_test.go
+++ b/storage/storage_image_test.go
@@ -3,8 +3,8 @@ package storage
 import (
 	"testing"
 
-	"github.com/containers/image/manifest"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/manifest"
+	"github.com/containers/image/v4/types"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/storage/storage_test.go b/storage/storage_test.go
index 3a65b99e..0cf4b516 100644
--- a/storage/storage_test.go
+++ b/storage/storage_test.go
@@ -18,8 +18,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/containers/image/pkg/blobinfocache/memory"
-	"github.com/containers/image/types"
+	"github.com/containers/image/v4/pkg/blobinfocache/memory"
+	"github.com/containers/image/v4/types"
 	"github.com/containers/storage"
 	"github.com/containers/storage/pkg/archive"
 	"github.com/containers/storage/pkg/idtools"
diff --git a/storage/storage_transport_test.go b/storage/storage_transport_test.go
index b2c119e2..5ac767b1 100644
--- a/storage/storage_transport_test.go
+++ b/storage/storage_transport_test.go
@@ -6,7 +6,7 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/containers/image/docker/reference"
+	"github.com/containers/image/v4/docker/reference"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/transports/alltransports/alltransports_test.go b/transports/alltransports/alltransports_test.go
index 190cbae5..8aca7601 100644
--- a/transports/alltransports/alltransports_test.go
+++ b/transports/alltransports/alltransports_test.go
@@ -3,8 +3,8 @@ package alltransports
 import (
 	"testing"
 
-	"github.com/containers/image/directory"
-	"github.com/containers/image/transports"
+	"github.com/containers/image/v4/directory"
+	"github.com/containers/image/v4/transports"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )