国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

制作dockerfile的流程
阿神
阿神 2017-04-25 09:03:37
0
2
885

最近看了一些Docker相關(guān)的知識(shí),對(duì)制作dockerfile的流程有一些不明白的地方。

假如要制作一個(gè)基于Ubuntu的包含Nginx、MySQL、PHP等服務(wù)的dockerfile,我現(xiàn)在的流程是:

  • docker run一個(gè)基本的Ubuntu鏡像

  • 更新系統(tǒng)依賴包,如:apt-get update,在文本文檔記錄執(zhí)行的命令

  • 安裝Nginx,在文本文檔記錄安裝Nginx執(zhí)行的步驟

  • ....

等于說(shuō)是先把流程跑一遍,記錄下所有執(zhí)行的命令,然后再把這些步驟復(fù)制到dockerfile里。

個(gè)人感覺這樣做是不對(duì)的,請(qǐng)問(wèn)大家都是怎么做的??

阿神
阿神

閉關(guān)修行中......

reply all(2)
洪濤

That’s right. If you are very familiar with all the processes, you can naturally write the Dockerfile directly. However, there is basically no absolute guarantee for this kind of thing. In particular, most of Docker’s basic system images are very streamlined, and some software dependency packages need to be downloaded and installed. Therefore, although the process of building a container by yourself is a bit time-consuming, it is relatively short. On the contrary, it will save time than dreaming about writing Dockerfile.

Usually writing a Dockerfile is a process like this:

  1. Preview the installation process through the container and record the build commands

  2. Summarize and optimize installation commands, and write Dockerfile

  3. Try to use Dockerfile to build the image and check if there are any problems

  4. Create a container through the built image to ensure that the program in it can be used correctly

習(xí)慣沉默

By referring to the ready-made dockerfile on docker hub and modifying it according to your own needs, it will be more efficient. To write the dockerfile from scratch, you can only do it like the brothers above. I call it the "video recorder" method.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template