Not every server can reach a registry, and sometimes an image only exists on my laptop. An archive file solves both.
docker save myapp:1.2 | gzip > myapp.tar.gz
# copy the file to the other machine, then:
docker load < myapp.tar.gz
docker save writes the image, with all its layers and tags, as a tar archive to standard output. Piping it through gzip keeps the file small. On the target machine, docker load reads it back and the image appears in docker images with its original tag. The documentation says load accepts compressed archives too, so the gzip file can be loaded directly.
You can also skip the intermediate file and send the image straight over SSH:
docker save myapp:1.2 | gzip | ssh user@server 'gunzip | docker load'
There is a -o option to write to a file instead of using a redirect, and you can list several images in one command to put them in one archive.
The caveat is that save is for images, not for containers. It does not include volumes or the data in a running container. For that, docker export and a volume backup are different jobs. The image architecture must also match the target, since an arm64 image will not run on an amd64 machine.
Further reading: docker image save, docker image load