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 realize Export, Import and data relocation by docker

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

Share

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

This article mainly explains "how to achieve export, import and data relocation in docker". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to export, import and data relocation in docker".

There are two types of docker export and import, one is backup image, and the other is backup container. Data relocation, the simplest rough is the direct COPY,volume path on the line.

One, export and import image

# Export to tar docker save # ID or # Name > / home/save.tar # Import tar docker load

< /home/save.tar 二,导出导入容器 #导出为tar docker export #ID or #Name >

/ home/export.tar # Import tar cat / home/export.tar | docker import-test:1.0

Third, data migration

1. Set-- volume when generating the container, and directly COPY the directory behind the container to the new server, or the path

2, and then docker run assigns-- volume to the new path.

If you don't know the path to-- volume, go to cd / var/lib/docker/containers/ and find the corresponding container. There is a configuration file in it

# cat hostconfig.json {"Binds": ["/ home/docker/redmine/redmine:/home/redmine/data"], "ContainerIDFile": ""

/ home/docker/redmine/redmine, this is what I set-- volume, if not-- volume can also be found here.

At this point, I believe you have a deeper understanding of "docker how to achieve export, import and data relocation". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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