In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Detailed explanation of Dockerfile instruction
As we all know, Dockerfile files use basic images to build new images, this blog only records some of the problems encountered by bloggers and some of their own understanding (will be constantly updated.); if you need to know every instruction of Dockerfile, you can google it yourself, and most of them are probably copied.
The difference between 2.RUN instruction and CMD,ENTRYPOINT instruction
After checking what is written on the Internet, most of them say that RUN is an instruction that runs when the docker build command is executed, while CMD,ENTRYPOINT is an instruction that runs when the docker run command is executed, which is not only winding, but also abstract and difficult to understand. Here, give two different Dockerfile file examples to more specifically understand the differences between these instructions:
1) Dockerfile file of RUN instruction.
# version 1.0.0.1FROM nginxMAINTAINER XXXXXX@163.COMRUN apt-get updateRUN apt-get install openssh-serverEXPOSE 22
For the Dockerfile file with the RUN instruction like above, when building the image, cd goes to the path where the Dockerfile file is located and uses the docker build command:
Docker build-t = "new_nginx:new_latest".
New_nginx: new image name
New_latest: new mirror version
The last count. Indicates that the Dockerfile file is found in the current directory
This explains that the RUN instruction is run during the execution of docker build
Second, the problem of building a new image in Dockerfile
1. Context issues at build time
In official documents, a common term is build context, which refers to the environment on which the build depends; for example, the directory where Dockerfile is located is a context. When you build a new image with Dockerfile, you will use files or scripts that must be in the same directory as the Dockerfile file.
In the process of coding development, there is also the concept of context, which means some variables, functions, etc., needed by the code to run; the concepts of these two contexts are basically the same-- that is, other things that build or run time depend on.
Https://www.jianshu.com/p/5f79b573c2fb
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: 208
*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.