Export a Docker Container

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.

Export

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.

Content for an exported container

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.

Published
Categorized as Docker

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.