Focus on big data and container cloud core technology decryption, can provide full stack of big data + cloud native platform consulting solutions, please continue to pay attention to this set of blog. If you have any academic exchange, please feel free to contact me. For more content, please pay attention to the public account of Data Cloud Technology Community.
1 Persistent container -export
- The export command is used to persist containers (not images).
- A container snapshot with centos.tar is displayed on the local PC.
2 Persistent image -save
- The Save command is used to persist images (not containers).
- Exporting an image as a file and importing the file as an image using the Docker load command saves all history of the image. Larger than the file exported by the Docker export command, which makes sense because it saves all the history of the image.
Sudo docker images then save: sudo docker save busybox-1 > /home/save.tarCopy the code
3 Import a container -import
- Use the docker import command to import the container as a new image,
- Now that we have a container snapshot, we can import it whenever we want. Use the docker import command to import snapshots.
- Note – it’s data flow
- Docker import can rename the image
For example we can use cat centos. Tar | docker import - my/centos: v888 import containers snapshot as a mirrorCopy the code
4 Import a container – Load
- Docker import can rename the image, docker load can not
Docker load < /home/save.tar displays all layers of the image sudo docker images --treeCopy the code
- Run the command to display the following information. Exported and imported images will lose all their history.
- A saved-loaded image does not lose history or layers.
- This means that with export and import, you can’t roll back to the previous layer, and with save and load persistence, you can do layer rollback (you can do docker tag rolling back and forth to the previous layer).
5 concludes
It’s practical, so that’s the summary.
Focus on big data and container cloud core technology decryption, can provide full stack of big data + cloud native platform consulting solutions, please continue to pay attention to this set of blog. If you have any academic exchange, please feel free to contact me. For more content, please pay attention to the public account of Data Cloud Technology Community.