1. 程式人生 > >Docker基礎映象centos6與centos6.x比較

Docker基礎映象centos6與centos6.x比較

       在編寫Dockerfile時,比較常用的基礎映象就是centos。在centos的版本中,也主要分為主版本和次版本。目前centos docker官方提供的映象版本如下:latest, centos7, 7centos6, 6centos7.4.1708, 7.4.1708centos7.3.1611, 7.3.1611centos7.2.1511, 7.2.1511centos7.1.1503, 7.1.1503centos7.0.1406, 7.0.1406centos6.9, 6.9centos6.8, 6.8centos6.7, 6.7centos6.6, 6.6其中比如centos7/centos6就是主版本,centos6.7/centos6.8就是次版本。對於centos映象的滾動構建,官方有以下的宣告:The CentOS Project offers regularly updated images for all active releases. These images will be updated monthly or as needed for emergency fixes. These rolling updates are tagged with the major version number only. For example: 
docker pull centos:6 or docker pull centos:7
翻譯如下:CentOS專案對所有的發行版本提供了定期更新。這些映象會每月或者緊急修復時進行更新。這些滾動更新只使用主版本號進行標記。比如“docker pull centos:6” 或者 “docker pull centos:7”官方對於次版本號的說明如下:Additionally, images with minor version tags that correspond to install media are also offered. These images DO NOT recieve updates
 as they are intended to match installation iso contents. If you choose to use these images it is highly recommended that you include RUN yum -y update && yum clean all in your Dockerfile, or otherwise address any potential security concerns. To use these images, please specify the minor version tag:
For example: docker pull centos:5.11 or docker pull centos:6.6翻譯如下:此外,同樣提供了小版本號的映象。這些映象不會接收更新,因為它們是為了匹配安裝iso的內容。如果你選擇了這些小版本號的映象作為基礎映象,那麼強烈建議你在Dockerfile中增加“RUN yum -y update && yum clean all”,或者去定位任何潛在的問題。使用這些映象,指定小版本號的tag如下:“docker pull centos:5.11”或者“docker pull centos:6.6”。     所以,根據Docker官方的建議,推薦使用centos6,centos7這樣的主版本號作為基礎映象,而不建議使用centos6.7這樣的此版本號。