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
Recently, when developing a small program, I enco...
introduction Currently, k8s is very popular, and ...
Preface In current JavaScript, there is no concep...
1. Use pseudo-classes to display half of the Bord...
disabled definition and usage The disabled attrib...
Table of contents Too long to read Component styl...
Written in front In today's Internet field, N...
Note: This article is about the basic knowledge p...
When developing mobile apps, you often encounter ...
Ubuntu 20.04 does not have root login enabled by ...
Table of contents 1. Installation 2. Import in ma...
Table of contents posgresql backup/restore mysql ...
The color matching in website construction is ver...
When Mysql associates two tables, an error messag...
<br />The information on web pages is mainly...