Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to import and export Docker containers

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How do I import and export Docker containers? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Method 1: import and export of containers (export and import)

1. View the containers to be exported

Docker ps-a

2. Export export

The exported tar file is transferred to the machine to be imported.

Docker export container name or the path to the ID > export of the container and the name of the tar package

Docker export centos > centos.tar

3. Import import

Docker import tar package path Custom Image name: TAG (default is latest)

Docker import centos.tar test/centos

There is already a new image on this new machine, and you can use this image to generate the container directly.

Method 2: export and import of images (save and load)

1. Save the image

Docker save > Custom tar package name Image name: TAG (default is latest)

Docker save > mysql.tar pinpointdocker/pinpoint-mysql:1.8.3

2. Import load

Docker load < mysql.tar

The difference between docker export and docker save

1. Docker save saves the image (image) and docker export saves the container (container)

2. Docker load is used to load the mirror package, and docker import is used to load the container package, but both of them will be restored to image.

After reading the above, have you mastered how to import and export Docker containers? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report