Image that is downloaded without a Docker registry share (Docker image local migration)

Source: Internet
Author: User
Tags docker hub docker registry

One of the most frequently encountered problems in learning Docker recently is that, when downloading Docker image, because of a well-known network failure, there are many solutions on the web, such as the use of a domestic mirroring service like the Docker Hub Mirror, But for personal reasons (lucky to have a foreign VM), I prefer not to share the downloaded image via Docker registry.

The problem is clear: Without Docker registry, the Docker image on a machine is shared with other machines, that is, the Docker image is migrated locally.

The scenario is simple: Use the Docker save and load commands, as follows
1. List all the Docker image on a machine and find the image name you want to save

sudo docker images

2. Use the Docker Save command on a machine to save the image as a tar file

sudo docker save Image_name-o File_path

Where Image_name is replaced with the image name you found in the first step to save. File_path is the exported tar file path, such as/home/tmp/image1.tar

3. Upload the exported image tar file to another machine, such as Machine B. Can be used in a variety of ways, such as the SCP, not detailed here.

4. Load the image tar file with the Docker load command on the machine that needs to use image (e.g. Machine B)

sudo docker load-i File_path  

Note: In addition, you can also use Docker's export and import command to achieve similar functions, about Export/save, import/load differences, you can check the Internet, do not expand here. The basic difference is that the export is the container (no history and layer information), and save is the image (with full history and layer information, support layer rollback)

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.