Docker export

svg viewer

What is the Docker export command?

Suppose you are working on a Docker container, and a colleague requests you to send it, but you are both in a different Docker environment. You can do this by using the export command.

export lets you make a .tar of your container, which can easily be transferred to another system by any means (i.e., flash-drive or cloud). The size of these .tar files are usually in MBs.

Options

Name, shorthand Description
- -output, -o Write to a file, instead of STDOUT

Format

docker export {Container Name} > {filename}

OR

docker export -o={filename} {Container Name}

If you only give the filename, the .tar the file will be saved in the root. If you want to save it somewhere else, you can concatenate the path to a directory as a prefix to the filename.

Example

For both examples, the container name is 123456789abc. The container 123456789abc will be exported into an edpresso.tar file:

docker export 123456789abc > edpresso.tar

OR

docker export -o="edpresso.tar" 123456789abc

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved