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.
Name, shorthand | Description |
---|---|
- -output, -o | Write to a file, instead of STDOUT |
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.
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