docker import and export images

There are two ways to import and export docker containers:

 

One is to use the save and load commands

The usage example is as follows:

docker save ubuntu:load>/root/ubuntu.tar

docker load<ubuntu.tar

 

One is to use the export and import commands

The usage example is as follows:

docker export 98ca36> ubuntu.tar

cat ubuntu.tar | sudo docker import - ubuntu:import

Note that the two methods cannot be mixed.

If you use import to import the file generated by save, although the import does not prompt an error, it will prompt a failure when starting the container.

An error like "docker: Error response from daemon: Container command not found or does not exist" will appear.

Similarly, using load to load files generated by export will also cause problems.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325847336&siteId=291194637