1. Export container If you want to export a local container, you can use the Docker Export command to export the container snapshot to a local file .
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7691a814370eUbuntu:14.04 "/bin/bash" $hours agoExited (0) +hours ago Test
$ sudo docker export 7691a814370e > ubuntu.tar
2. Import container snapshots can be imported from the container snapshot file as mirrors using Docker import, for example
< Span class= "PLN" style= "Color:rgb (72,72,76)" >$ cat ubuntu . tar | sudo docker import - test / ubuntu : v1 0
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
< Span class= "PLN" style= "Color:rgb (72,72,76)" >test / ubuntu v1 0 9d37a6082e97 about a minute ago 171.3 MB
Alternatively, you can import by specifying a URL or a directory, such as
$sudo Docker import http : //example.com/ Exampleimage.tgz example/imagerepo
* Note: Users can either use Docker load to import a mirrored storage file to a local mirror library, or you can use Docker import to import a container snapshot to a local mirror library. The difference between the two is that the container snapshot file discards all history and metadata information (that is, only the snapshot state of the container at that time), while the mirrored storage file will hold the full record and be larger in size. In addition, metadata information such as labels can be re-specified when importing from a container snapshot file.
Export and import Docker containers using Export/import