In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Docker imports local images
Sometimes we copy an image on our local or other partner's computer. With this image, we can import the local image and use the docker import command.
For example, an alibaba-rocketmq-3.2.6.tar.gz image file is downloaded here and imported using the following command:
[root@rocketmq-nameserver4 dev] # cat alibaba-rocketmq-3.2.6.tar.gz | docker import-rocketmq:3.2.6 (self-defined image name) [root@rocketmq-nameserver4 dev] # docker imagesREPOSITORY TAG IMAGE ID CREATED SIZErocketmq 3.2.6 53925d1cf9f0 23 seconds ago 14MBmy/python v1 36b6e288656c 2 days ago 281MBmy/centos_width_python v1. 0.1 36b6e288656c 2 days ago 281MBmy/sinatra v2 8ba1d6a3ce4e 2 days ago 453MBhello-world latest 725dcfab7d63 4 months ago 1.84kB
You can see that after the import is complete, docker generates an image ID for us, and using docker images, you can also see the image we just imported locally.
Note that the image file must be of type tar.gz.
[root@rocketmq-nameserver4 dev] # docker run-it rocketmq:3.2.6 / bin/bash # # initiating the import of a local image will report the following exception
Docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec:\" / bin/bash\ ": stat / bin/bash: no such file or directory.
Solution: I don't know for the time being. If you have any knowledge, please leave a message below. Thank you in advance.
2. Save the image
After our image is done, we need to save it for backup. What should we do? Use the docker save command to save the image locally.
[root@rocketmq-nameserver4 dev] # docker save-o rocketmq.tar rocketmq # #-o: specify the name of the saved image; rocketmq.tar: save to the local image name; rocketmq: image name. View [root@rocketmq-nameserver4 dev] # ll through "docker images"
Rocketmq.tar is the image just saved
3. Load the image
We have a local image file, and we can use docker load to import the locally saved image into docker again when needed.
Docker load-- input rocketmq.tar or docker load < rocketmq.tar
4. Delete the image
Some images are out of date and we need to delete them. Use the following command: docker rmi-f image_id # #-f: forcibly delete the image; image_id: image id
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.