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

Sample Analysis of Docker Import and Export

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Xiaobian to share with you Docker import and export example analysis, I believe most people still do not know how, so share this article for your reference, I hope you have a lot of harvest after reading this article, let us go to understand it together!

export&importsave&load action object container mirror export object tar file tar file import object mirror layer number of layers one layer multiple layers

Let's explain it line by line

operation object

Export and import are used to import export containers, while save and load are used to import export images.

For example, if you need to migrate container A from machine A to machine B, and there is important data in container A that needs to be migrated along with it, you can use export and import parameters to import and export.

For example: your server cannot pull down an image, but you have an overseas machine, you can pull down the image you want on the overseas machine, and then export the image as a tar package with the save command, and then pull the tar package back to the local import.

Therefore, from the functional orientation, you just remember that the save and load parameters are used to migrate the mirrored scene, and the other export and import are of course used to migrate the container.

export object

In exporting objects, export and save export files in the same form, both exported as a tarball

import object

On imports, import and load are both a mirror image imported via tar packages

Number of imported mirror layers

The biggest difference is that when containers exported through export and import are mirrored, the mirror has only one layer

The image exported through save and load retains all the hierarchical structure of the original image. When exporting, the original image has several layers, and when importing, it still has several layers.

What if I want to export containers but still want to preserve the hierarchy?

Export containers, and soon came up with the only tool that can export containers export

However, if you want to preserve the hierarchy of the underlying mirror, then export does not meet the requirements.

Think about exporting tools with a hierarchy, only the mirror export tool saves, but the container has a new layer of data on top of the mirror layer. How to export it together?

At this point, you need to introduce a new parameter commit, which is used to save the existing state of the container as a new mirror.

For example, the container A running on machine A is based on the image of Party A and Party B. Then I can save all the contents of container A as a new image through the commit parameter, and the name is Private Custom (including a stalk). Finally, I can export the private custom image (that is, container A) as a tar package through the image export tool save.

And contains X+1 layer mirror image, X layer is the original mirror A B all mirror layers, 1 is the container A more than that layer can write the mirror layer

The above is all the content of this article "Docker import and export example analysis", thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

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