background The popularity of Docker is closely related to its easy sharing and portability of containers. Users can not only submit containers to public servers, but also export containers to local file systems. Similarly, we can also import the exported container back into the Docker runtime environment. Method 1: Import and export of containers (export and import) 1. View the container that needs to be exported docker ps -a 2. Export The exported tar file is transferred to the machine to be imported docker export container name or container ID > exported path and tarball name docker export centos> centos.tar 3. Import docker import tarball path custom image name: TAG (default is latest) docker import centos.tar test/centos Now there is a new image on the new machine, and you can use this image to directly generate a container. Method 2: Export and import of images (save and load) 1. Save the image docker save > Customize tarball image name: TAG (default is latest) docker save > mysql.tar pinpointdocker/pinpoint-mysql:1.8.3 2. Load import docker load < mysql.tar The difference between docker export and docker save 1. Docker save saves the image, and Docker export saves the container. 2. Docker load is used to load image packages, and Docker import is used to load container packages, but both will be restored to images; Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue2 implements provide inject to deliver responsiveness
For those who are new to virtual machines or have...
MySQL is a database that I like very much. Today,...
Table of contents 1. Several syntaxes of Insert 1...
When Docker creates a container, it uses the brid...
In web design, we often use arrows as decoration ...
Preface When creating a primary and foreign key f...
This article records the installation graphic tut...
1. The effect diagram implemented in this article...
Table of contents Object Object Definition Iterat...
When writing HTML code, the first line should be ...
The following is the configuration method under c...
Written in front A database is essentially a shar...
In Linux, there are two types of file connections...
introduction The company's recent Vue front-e...
The team replaced the new frame. All new business...