<> One , Image export save
<> View image
docker images
<> Export image
docker save -o test.tar image_name
perhaps
docker save image_name > /test.tar
<> Two , Container export export
<> Export container , The command format is :
docker export [-o|--output[=""]] CONTATINER
or
docker export container id/name > file name .tar
for example :
docker export -o test.img test
test.img : You can export it here tar file , You can also export binary image files img
test : Container name to export , adopt docker ps see
<> Three , Import compressed package ( Includes compressed images and containers )
<>1.import
docker import [-c|--change[=[]]] [-m|--message[=MESSAGE]] file|URL|-[REPOSITORY
[:YAG]]
for example :
docker import test.img test
test : Is the image name
<>2.load
docker load --input /test.tar
<> difference :
* docker save The image is saved (image),docker export The container is kept (container);
* docker load Used to load the image package ,docker import Used to load container packages , But both will revert to mirror images ;
* docker load Cannot rename a loaded image , and docker import You can specify a new name for the mirror .
<> Four , Deploy image
<> Start mirror
docker run -d --name container_test --privileged -it test:latest /usr/sbin/init
Technology
Daily Recommendation