Moving a docker image around

I’m trying to build a docker image in an Ubuntu 23.04 Virtualbox VM under macOS.
The installation is a bit flaky. It doesn’t complete and is often interrupted at random points.

Would it be possible to build the docker image on a different machine and then transfer the image to the Ubuntu VM?

Sure you can.

Export a build image:

Import an image export:

This approach usually makes only sense in an air-gapped environment. In all other cases we build and push images to a registry, and then pull the image on the target machine.