docker export
Table of Contents:
Command Name:
docker export
Description:
Export a container’s filesystem as a tar archive
Syntax:
easywhatis$ docker export --help
Usage: docker export [OPTIONS] CONTAINER
Export a container's filesystem as a tar archive
Options:
-o, --output string Write to a file, instead of STDOUT
easywhatis$
Example:
easywhatis$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5bb226d1850 ubuntu "bash" 4 hours ago Up 4 hours eloquent_knuth
easywhatis$ docker export a5bb226d1850 > ubuntu_export.tar
easywhatis$ ls -lt
total 131464
-rw-r--r-- 1 easywhatis staff 66583040 Apr 12 16:29 ubuntu_export.tar
drwx------+ 16 easywhatis staff 512 Apr 12 12:51 Desktop
-rw-r--r-- 1 easywhatis staff 23 Apr 12 10:52 test.txt
drwx------+ 9 easywhatis staff 288 Apr 12 10:50 Movies
drwx------+ 43 easywhatis staff 1376 Apr 11 18:15 Downloads
drwx------+ 5 easywhatis staff 160 Apr 5 11:10 Documents
drwx------@ 60 easywhatis staff 1920 Mar 29 19:49 Library
drwx------@ 3 easywhatis staff 96 Mar 28 10:16 Applications
drwx------+ 3 easywhatis staff 96 Mar 28 10:09 Music
drwx------+ 3 easywhatis staff 96 Mar 28 10:09 Pictures
drwxr-xr-x+ 4 easywhatis staff 128 Mar 28 10:09 Public
easywhatis$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5bb226d1850 ubuntu "bash" 4 hours ago Up 4 hours eloquent_knuth
easywhatis$