With Docker CLI, we can export containers to a .TAR from one host to another, and in this post, we will learn how to do that.
The Docker CLI utility has a built-in command for exporting containers. The command is export and is available natively.
In the following example, I am exploring a container called deply01 to a .TAR file called deploy01.tar.
docker export deploy01 > deploy01.tar
After exporting the container, I can open the .TAR file and see all the content below.
It is important to note that exporting a container with an attached volume will not export the actual volume, but the data inside the volume will be exported.