In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what are the basic uses of docker", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the basic uses of docker" this article.
1. List all mirrors: docker images
Tips: sometimes you may see names like "ubuntu:14.04" and "ubuntu:12.04". In fact, ":" is followed by tag, and the tag in the picture is "latest".
You can also run it like this:
two。 Search for images on dockerhub: docker search IMAGE_NAME
You can see a lot of results.
3.commit (equivalent to update) an image: docker commit-m = "MESSAGE"-a = "AUTHER_NAME" CONTIANER_ID USER/REPOSITORY:TAG
Run the container first (remember the set of id behind root at this time):
I installed erlang:
Finally commit it (remember to quit first):
In fact, commit can almost be seen as solidifying the container into image.
Look at the mirror image I have now:
Run it:
4. Create an image from Dockerfile: docker build-t = "SOURCE_IMAGE_ID USER/REPOSITORY:TAG". (note the last ".")
Tips: I don't know if it's rp or bug. Even though the image of docker build that I installed according to the official manual on 14.04 specifies tag, there is no information in the results of docker images, only ID, which needs to be tag (I'll talk about it later).
First create a folder, cd into it, and create a file called "Dockerfile":
My file is shown in the figure:
"#" begins with comments, instructions such as RUN must be capitalized, FROM refers to the source image (I created from a source image), and performs the operation of installing ntp. Note: if you do not understand what-qq means, please refer to the apt-related information (meaning nothing but errors).
Build: please pay attention to the following "." if Dockerfile is in this directory, you can use a little instead of the path, but you can also configure the path.
The problem arises:
There's a none? Bug?
We need to tag and add information to it: docker tag IMAGE_ID CONTIANER_ID USER/REPOSITORY:TAG
Look at my image list again:
It's normal.
5. Delete containers and images: docker rm CONTAINER_NAME / docker rmi IMAGE_NAME
Because there are several images with no information, I want to delete it:
He prompts that a container is using it, remember the container id, delete the container and then delete the image.
6. Add:
List all running containers: docker ps-a
List the latest status of the container: docker ps-l (show the results of only one container)
These are all the contents of this article entitled "what are the basic uses of docker?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.