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
Part 1: Basics 1. Unlike pseudo-classes such as :...
Basic Concepts Before operation, you must first u...
This article describes how to export and import ....
WeChat applet form validation, for your reference...
1. Use the df command to view the overall disk us...
1. Introduction to mysqldump mysqldump is a logic...
Web Server 1. The web server turns off unnecessar...
1. Install Docker First open the Linux environmen...
Today I happened to be helping a friend move his ...
x-ua-compatible is used to specify the model for ...
This time, we will try to package the running con...
Before introducing the GROUP BY and HAVING clause...
This article example shares the specific code for...
RGBA is a CSS color that can set color value and ...
Preface This article mainly introduces the analys...