Most of the time I load images with docker load. docker import is the other one, and it does something different: it takes a plain filesystem archive and makes an image out of it.
docker import /path/to/exampleimage.tgz
cat exampleimage.tgz | docker import - exampleimagelocal:new
docker import --change "ENV DEBUG=true" ./rootfs.tgz exampleimagedir
The docs describe it as importing the contents from a tarball to create a filesystem image. The source can be a file, a URL or - for stdin, and the supported archives are .tar, .tar.gz, .tgz, .bzip, .tar.xz and .txz. The second argument is the repository and tag. Without it you get an untagged image.
You can set --change more than once to add Dockerfile instructions. That is how you give the image a CMD or ENV, because a bare tarball carries no configuration. The docs say the list is limited to metadata changes, so not every instruction works.
Caveats from the docs: when you import a directory, you need to keep the file ownership, especially root ownership, while you archive it with tar. And there is --platform for multi-platform daemons, otherwise the daemon’s native platform is used.
A good pairing is docker export, which writes a container’s filesystem to a tar. Import that archive again and you get an image of that filesystem. I’d keep the original image around until I have checked the result.
Further reading: docker image import