orisano/minid ã®è©±
ä¸ã®ãã¼ã«ãä½ã£ãã®ã§ç´¹ä»ã®è¨äºã§ã.
èæ¯
åã¯ã¢ããªã±ã¼ã·ã§ã³ã¨ã³ã¸ãã¢ã¨ãã¦Dockerfileãããããæ¸ããã¨ãããã®ã§ãã,
å··ã«ããµããDockerfileãRUNä¸ã¤ã«ã¾ã¨ãããã¦ããã®ããã£ã¨ä¸æè°ã«æã£ã¦ãã¾ãã.
è¦æ ããæªãã, ããã£ã¦ã¡ã³ããã³ã¹å¯è½ãªãã ããã. ãããããªããã£ã¦ãããã ããã¨.
In older versions of Docker, it was important that you minimized the number of layers in your images to ensure they were performant. The following features were added to reduce this limitation:
In Docker 1.10 and higher, only the instructions RUN, COPY, ADD create layers. Other instructions create temporary intermediate images, and do not directly increase the size of the build.
In Docker 17.05 and higher, you can do multi-stage builds and only copy the artifacts you need into the final image. This allows you to include tools and debug information in your intermediate build stages without increasing the size of the final image.
ä¸ã®è¨äºãè¦ãã¨, å¤ããã¼ã¸ã§ã³ã®Dockerã«ããã¦ã¯, ã¤ã¡ã¼ã¸ã®ã¬ã¤ã¤ã¼æ°ãæå°åãããã¨ãéè¦ã ã£ãã¨æ¸ãã¦ããã¾ã.
- Docker 1.10 ããåã®ãã¼ã¸ã§ã³ã®RUN, COPY, ADD以å¤ã®å½ä»¤ã§ããã«ãã®ãµã¤ãºã大ãããªã£ã¦ãã¾ãåé¡ç¹
- Docker 17.05 ããåã®ãã¼ã¸ã§ã³ã§ã¯multi-stage buildsã使ç¨ã§ããªãæ ã«, ã¤ã¡ã¼ã¸ã大ãããªããã¡ãªåé¡, ãã¼ã«ãå ¥ãã¦ä½¿ãã®ã«æ°ã使ããªãã¨ãããªãåé¡
以ä¸ã®åé¡ç¹ã«ãã, ã¬ã¤ã¤ã¼ã®æ°ãã©ãããã¨ããããã¤ã¡ã¼ã¸ã®ãµã¤ãºã«ã¤ãã¦è§¦ãããã¦ãããã¨ãå¤ãã§ã.
17.05以éã®ãã¼ã¸ã§ã³ã使ããç°å¢ã«ããã¦ã¯RUN, COPY, ADDã®æ°ãã¬ã¤ã¤ã¼ã®æ°ã«ãªãã¾ãã, multi-stage buildsãæ´»ç¨ãããã¨ã§ã¤ã¡ã¼ã¸ã®ãµã¤ãºã¯å°ããã§ãã¾ãã®ã§ã¬ã¤ã¤ã¼æ°ãã©ãããã¿ãããªãã¨ã¯èããªãã¦è¯ãã¨æãã¾ã.
ã¡ãªã¿ã«ãªãã¤ã¡ã¼ã¸ã®ãµã¤ãºãæèãããã¨ããã¨pull, pushã®é度ã«å¯ä¸ããããã ã¨æã£ã¦ãã¾ã.
ãããã®ã»ãã®è¦³ç¹ã§ã¤ã¡ã¼ã¸ã®ãµã¤ãºãå°ããããçç±ãããã¨ããæ¹ã¯æãã¦ããã ããã¨å¹¸ãã§ã.
orisano/minid
ãã®ãã¼ã«ã¯ä¸ã®èæ¯ã«ã¤ãã¦ç解ãã¦ãªãã£ãåãä½ã£ãé£ç¶ãã¦ããRUN, COPY, ADDãçµåãã¦ããããã¤ã§ã.
æ©æ¢°çã«RUN, COPY, ADDãçµåãããã¨ã§ã¤ã¡ã¼ã¸ã®ãµã¤ãºãå°ãããããã¨ãã§ãã¾ã. ããã,ã¬ã¤ã¤ã¼æ°ãæ¸ãããã¤ã¡ã¼ã¸ãµã¤ãºãæ¸ãããã§ã¯ãªãã§ã.
å³å¯ã«ã¯éãã®ã§ãã以ä¸ã®ãã¼ã¸ã®å³ãåç §ãã¦ããã ããã¨ããããããã¨æãã¾ã.
AUFS ストレージ・ドライバの使用 — Docker-docs-ja 17.06.Beta ドキュメント
Dockerã®ã¤ã¡ã¼ã¸ã¯ãã¡ã¤ã«ã·ã¹ãã ã®å·®åã§æ§æããã¦ãã, ãã¡ã¤ã«ã®åé¤ã¯Whiteoutãã¡ã¤ã«ã§è¡¨ç¾ãã, 移åãªã©ã¯Opaqueãã¡ã¤ã«ã§è¡¨ç¾ããã¦ãã¾ã.
Dockerfileã®ãã¹ã¦ã®ã¬ã¤ã¤ã¼ã§ç¬ç«ãªãã¡ã¤ã«ãä½æ, å¤æ´ãã¦ããã°ã»ã¨ãã©ç¡é§ããªãã®ã§åé¡ããã¾ãã.
ããã, RUNã§å®è¡ãããã³ãã³ããã©ããã£ããã¡ã¤ã«ãä½ã£ããå¤æ´ããããããããã¹ã¦ææ¡ãã¦ãããã¨èãããã°æªããã¨æãã¾ã. (ç¹ã«cacheå¨ããªã©)
æ©æ¢°çã«RUNãã¾ã¨ãããã¨ã§, èªåãæèããªããã¡ã«ã¬ã¤ã¤ã¼ãè·¨ãã§è§¦ãã¦ãããã¡ã¤ã«åã®ãµã¤ãºãå°ãããªãã¾ã. ããããµã¤ãºãå°ãããªãåçã§ã.
ã¾ãå·®åã§ä¿æãã¦ããã¨ããåæãç¥ããªãã¦ãé£ç¶ãã¦ããå ´åã®ã¿åé¿ãããã¨ãã§ãã¾ã.
ä¸çªéè¦ãªã¡ãªãããã¦ã¯, 人éã &&
ãç¡éã«æ¸ããªãã¦ãè¯ããªãã¨ããã§ã.
minidã§ã¯buildkitã®å é¨ã«ããDockerfileã®ãã¼ãµã使ç¨ãASTãåå¾ã, ã©ã³ã¬ã³ã°ã¹å§ç¸®ã®è¦é ã§ã¾ã¨ãã¦ããã ãã§ã.
Dockerfileã®parserã¯æå¤ã¨ç°¡åã«ä½¿ããã®ã§ä½¿ã£ã¦ããã¡ããä½ã£ã¦ã¿ãã¨é¢ç½ãããç¥ãã¾ãã.
ãã²é¢ç½ãããã¡ããã§ããã¨ãã¯æãã¦ãã ãã.
çµããã«
å人çã«ãã®ãã¼ã«ã®ãã¾ãè¦ãªãç¹ã¯, Dockerfileãåãåã£ã¦Dockerfileãè¿ãç¹ã ã¨æã£ã¦ãã¾ã.
éçºè ãæ¸ããããDockerfileã¨å°ããæé©ãªDockerfileã¯å¥ç©ã ã¨æã£ã¦ãã¦,åè ããæ©æ¢°çã«å¾è ãä½ããã¨ä¿¡ãã¦ããã®ã§Dockerfileãå å·¥ããã·ã³ãã«ãªãã¼ã«ãä½ã£ã¦ãã¾ã.
ãããCIä¸ã§Pipelineã«ãããã¨ã§éçºè ã®è² è·ãä¸ã, é«éãªbuild, é«éãªdeployã®å®ç¾ã夢ã¿ã¦ãã£ã¦ãã¾ã.
ãã¼ã«ãè¯ãã¨æã£ããGitHubã§Starãã¦ãããã¨å±ã¿ã«ãªãã¾ã.