首页 > 其他分享 >An Introduction to Kaniko

An Introduction to Kaniko

时间:2023-06-18 23:23:39浏览次数:41  
标签:daemon Kubernetes Introduction Kaniko 镜像 Docker Dockerfile

An Introduction to Kaniko

https://www.baeldung.com/ops/kaniko

Kaniko is a tool to build container images from a Dockerfile. Unlike Docker, Kaniko doesn't require the Docker daemon.

Since there's no dependency on the daemon process, this can be run in any environment where the user doesn't have root access like a Kubernetes cluster.

Kaniko executes each command within the Dockerfile completely in the userspace using an executor image: gcr.io/kaniko-project/executor which runs inside a container; for instance, a Kubernetes pod. It executes each command inside the Dockerfile in order and takes a snapshot of the file system after each command.

If there are changes to the file system, the executor takes a snapshot of the filesystem change as a “diff” layer and updates the image metadata.

 

无需特权在Kubernetes中构建镜像之 Kaniko

https://zhuanlan.zhihu.com/p/108860437

Kaniko 简介

Kaniko 是 Google 造的轮子之一,用于在 Kubernetes 上无需特权模式构建 docker image

Kaniko 不依赖Docker daemon守护程序,而是完全在userspace中执行Dockerfile中的每个命令。这使您可以在没有特权模式或没有运行Docker daemon的环境(例如:Kubernetes集群)中构建容器镜像。

Kaniko 工作原理

传统的 Docker build 是 Docker daemon 根据 Dockerfile,使用特权用户(root)在宿主机依次执行,并生成镜像的每一层。

Kaniko 工作原理和此类似,Kaniko 执行器获取并展开基础镜像(在Dockerfile中FROM一行定义),按顺序执行每条命令,每条命令执行完毕后为文件系统做快照。快照是在用户空间创建,并与内存中存在的上一个状态进行对比,任何改变都会作为对基础镜像的修改,并以新层级对文件系统进行增加扩充,并将任何修改都写入镜像的元数据中。当Dockerfile中每条命令都执行完毕后,执行器将新生成的镜像推送到镜像仓库中。

Kaniko 解压文件系统,执行命令,在执行器镜像的用户空间中对文件系统做快照,这都是为什么Kaniko不需要特权访问的原因,以上操作中没有引入任何 Docker daemon 进程或者 CLI 操作。

 

 

标签:daemon,Kubernetes,Introduction,Kaniko,镜像,Docker,Dockerfile
From: https://www.cnblogs.com/lightsong/p/17489980.html

相关文章

  • An Introduction to Linux Automation, Tools and Techniques
    AnIntroductiontoLinuxAutomation,ToolsandTechniqueshttps://linuxconfig.org/an-introduction-to-linux-automation-tools-and-techniquesInthefast-pacedworldoftechnology,automatingroutinetaskscanbethekeytoincreasedefficiencyandproducti......
  • DSP网课笔记 ξ0_introduction
    网课链接(是一个开设给研究生的课程)离散时间信号处理吴炳飞概论课程目标是建立基本的DSP观念DSP的研究对象:信号要将模拟信号转换为数字信号,必须知道所研究信号的特性(对数字的敏感)......
  • Hadoop YARN - Introduction to the web services REST API’s
    HadoopYARN-IntroductiontothewebservicesRESTAPI’sOverviewURI’sHTTPRequestsSummaryofHTTPoperationsSecurityHeadersSupportedHTTPResponsesCompressionResponseFormatsResponseErrorsResponseExamplesSampleUsageOverviewTheHadoopYARNwebservice......
  • w task 2 - introductions
    Method:2sentencesintroducethetopicgiveageneralanswer30-40words. Fourtypesofquestion:DiscussionOpinionProblemandsolutiontwo-partquestion Discussion:Plan:Topic-AorBAnswer:sometimesAbutusuallybetterBPeoplehavediff......
  • SIP Introduction
     SIPChapter1.SIP1.1.PurposeofSIPSIPstandsforSessionInitiationProtocol.Itisanapplication-layercontrolprotocolwhichhasbeendevelopedanddesignedwithintheIETF.Theprotocolhasbeendesignedwitheasyimplementation,goodscala......
  • Brief Introduction
    BriefSummariesofTopics0.1LinearAlgebra0.2RealAnalysis0.3DifferentialVector-ValuedFunctions0.4PointSetTopology0.5ClassicalStokes'Theorems0.6DifferentialFormsandStrokes'Theorem0.7CurvatureforCurvesandSurfaces0.8G......
  • Introduction to WebGL 3D with HTML5 and Babylon.js
    Explore3Dbasics,andtakealookat3Dwithouthardware(creatingasoftwareengine).[05:45]-Understanding3DBasicsviaasoftengine[09:49]-UnderstandingtheTransformationpipeline[20:26]-Itsallabouttriangles[31:42]-MovingfromCPUto......
  • 1.OS-Introduction|Begin
    VonNeumannmodelofcomputingManymillions(andthesedays,evenbillions)oftimeseverysecond,**theprocessorfetchesaninstructionfrommemory,decodesit(i.e.,figuresoutwhichinstructionthisis),andexecutesit**operatingsystemInfact,......
  • docker_1_introduction
    这是我的个人博客,欢迎关注Docker是一个开源的应用容器引擎,基于Go语言,并遵从Apache2.0协议开源。Docker可以让开发者打包他们的应用以及依赖包到一个轻量级、可移植的容器中,然后发布到任何流行的Linux机器上,也可以实现虚拟化。Docker容器是完全使用沙箱机制,相互之间不会有......
  • 10 Geometry(Introduction)
    关键点ImplicityGeometryAlgebraicSurfaceContructiveSolidGeometry(CSG)DistanceFunctionsExplicityGeometryPointCloudPolygonMesh1.RepresentGeometry1.1ImplicitGeometry隐式几何不说明点的位置,而是给出点的关系,得到一个点的集合,即一个几何的表示。......