Export and import Docker containers using Export/import

Source: Internet
Author: User
Tags docker ps

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.