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 backup, restore, migrate, Import and Export in Docker Container

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is about how to back up, restore, migrate, import, and export in a Docker container. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Docker is an open source application container engine, based on the Go language and open source in accordance with the Apache2.0 protocol; cross-platform application container engine services.

Experimental environment

Operating system: Ubuntu 18.04.4 LTS

Application version: Docker version 19.03.9, build 9d988398e7

Image example: mysql:5.6

Note: the Docker container must be installed first. Refer to: https://www.linuxprobe.com/ubuntu-install-docker-ce

Docker packages applications and dependencies into a lightweight, portable container, and then publishes them to any popular Linux machine, which can also be virtualized. Docker is a cross-platform container engine that supports Windows, MAC OS, Linux, etc.

The container completely uses the sandbox mechanism and does not have any interfaces with each other, which implements the resource isolation technology, and the resources in the container do not affect each other. More importantly, the container performance overhead is extremely low.

Docker image pull

Root@linuxcool:~# docker pull mysql:5.65.6: Pulling from library/mysqle62d08fa1eb1: Pull complete c4539e638b12: Pull complete 0acb8f0db2a3: Pull complete e27254901ad3: Pull complete 91e4d538a032: Pull complete 8608c48c2d69: Pull complete 2b7bbeb5e044: Pull complete f86c472cfc00: Pull complete 3081c249e0ee: Pull complete caddb3474aca: Pull complete ec101f8c3a86: Pull complete Digest: sha256:60c27b50ca72d81d92a743a965a82f124a4e123c7d374a021887286408878d60Status: Downloaded newer image for mysql:5.6docker.io/library/mysql:5.6

Docker container backup

Root@linuxcool:~# docker image save mysql:5.6-o mysql:5.6.tar.gzmysql:5.6: local image mysql:5.6.tar.gz: packaged image file

Docker Container Export

Root@linuxcool:~# docker save mysql:5.6 > mysql:5.6.tar.gzmysql:5.6: local image mysql:5.6.tar.gz: packaged image file

Docker Container recovery

Root@linuxcool:~# docker image load-I mysql:5.6.tar.gzmysql:5.6.tar.gz: packaged image file

Docker container import

Root@linuxcool:~# docker image load < mysql:5.6.tar.gzLoaded image: mysql:5.6mysql:5.6.tar.gz: packaged image file

Docker Container Migration

In fact, Docker container migration is to migrate existing servers that are already running Docker containers to a new container. We can complete the migration by backing up, restoring, importing and exporting operations above. If there are many enterprise images, you can also configure a private repository to pull the synchronized image resources to be migrated, and then run the pulled images. In this way, you can also complete the container migration process. The installation and configuration of the private repository harbor will be released later, so that all the images in the business can be pushed to the private warehouse to improve work efficiency.

Thank you for reading! This is the end of the article on "how to back up, restore, migrate, import and export in the Docker container". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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