Import and export of Docker imagesThis article introduces the import and export of Docker images, which are used in scenarios such as migration, backup, and upgrade. The environment is prepared as follows:
Introduction to import and export commandsThe commands involved are export, import, save, load save Order docker save [options] images [images...] Example docker save -o nginx.tar nginx:latest Or docker save > nginx.tar nginx:latest The -o and > indicate output to a file, nginx.tar is the target file, and nginx:latest is the source image name (name:tag) load command docker load [options] Example docker load -i nginx.tar Or docker load < nginx.tar -i and < indicate input from a file. The image and related metadata, including tag information, will be successfully imported export command docker export [options] container Example docker export -o nginx-test.tar nginx-test Where -o means output to a file, nginx-test.tar is the target file, and nginx-test is the source container name (name) import command docker import [options] file|URL|- [REPOSITORY[:TAG]] Example docker import nginx-test.tar nginx:imp or cat nginx-test.tar | docker import - nginx:imp the differenceThe tar file exported by the export command is slightly smaller than the one exported by the save command.
suggestion
This is the end of this article about the import and export code examples of Docker images. For more information about importing and exporting Docker images, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: vue-cli introduction and installation
>>: Summarize the common application problems of XHTML code
Overview The prototype pattern refers to the type...
Table of contents history pushState() Method push...
Table of contents About Triggers Use of triggers ...
<br />What is web2.0? Web2.0 includes those ...
structure body, head, html, title text abbr, acro...
Description Solution VMware 15 virtual machine br...
1. Download and decompress 1. Introduction to Zoo...
What is Virtual Memory? First, I will directly qu...
1. Introduction to TypeScript The previous articl...
Table of contents The beginning of the story Inst...
1. Installation of Docker under CentOS8 curl http...
Table property settings that work well: Copy code ...
The <input> tag The <input> tag is us...
Find the installation directory of VirtualBox. Th...
Table of contents 1. How to find duplicate rows 2...