{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/58",
    "result": {"data":{"issuesJson":{"id":"737b1a70-4e64-5fc9-9218-ecfd0e12d3ff","title":"moby/buildkit: 增强 Docker build 的功能，支持并行构建、缓存、镜像导出等功能","number":58,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/moby/buildkit\">moby/buildkit</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/4cb8e73504258e1c8b7a3dc45143a3bd3510a01df48cae081e9be136a80e7de8/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6d6f62792f6275696c646b69742e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/moby/buildkit.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/8ec6beae801b63494f4e2d05da807a14842e79570f46c8cd971e064fe017dd89/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6d6f62792f6275696c646b69743f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/moby/buildkit?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/43c12587fa70a25f0db410ae0fa8b3b37fb738ee6140174d74b83cee2f10f0a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6d6f62792f6275696c646b69743f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/moby/buildkit?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/08625bcbb5f29a74c3656522913365568baf5b609df2f978cebcd02552dbd451/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f62792f6275696c646b69743f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e53556845556741414144414141414177434159414141425841766d48414141414358424957584d41414173544141414c457745416d70775941414144336b6c45515652346e4f335953557a5555426748384a726f57567255474a66456d3773584e63534446784d544c327069347348456778654e526f77586770455742445552522532424e414e4f4b4f4b36366f6f4b4a4742586545475263574163455646475152484677516d483525324630774861655748493944554455354c356b6e6568644f62377a66652532423139636e434a47495243516945596c514237594a4979474c38616f73756c565a36695246516a69474b6b7564576735614c6c704f70704e586e665071773555304459524a6d56786a4367464633424c755a476d416f5655694b4541726d583744375553677351706f72674761336748664b34483663754262435644334771683141352532424c6745253242467749656e514d306a6f446f66714c6f48564e7742796d384370546e416d327a51713073676478624964515a556c416b7150415a3664676a303541446f59526f6f66792532466f5869726f376b3551586a4c6f70677a4b69514e6c4c4461716f4967754577426a7a7150355066446a45394479495879493633464d547751464d43567271774e61763451666f52673538514625324266724d485172454b3844546f434d714e4179574e4866786d54526f4c4f726d5352566747744466714345715a4f4851727a6f34706243557341333431365169364551394b476a6345465267484f724f4b6e5536574162396247455459656b4b7843766a546167394534706a653534446b3551503862624d4859762532464333756541654a6b50304f4778422532424a70426e4172595238455951516e6f4e31414e4661426e5050356c385372736559514c303641646b30464a5938484f5761424d6c6541486a683068506f73497a6c6f3876304125324633345a694f6548726130714b52504d5653493774762532423932747725324676687855654252713456454c674d376642714b354770526d6f514c584e7075625475367a6f4e52706754386e5051627138347764253246494375767978694b4871694e41664933774d367549684271476b4c696977414f734b44714f68743749747239567938536a52424557667941627225324668523142667056514664484a42253246423268683778376a36517077435665655951326b72554235436c636a3641326d3067576a25324244306d4c34397a573563517943484c4e37726a6c6d6d6174457958582532464372547a412532466f51785a6b576c39474a5443566f25324279546a3837253242346769504b6376307149486f344156344430565a727251493334706e70524d36357875652532467a417265453425324654253246536f676c664542794d7369517441546c4c3352414a355948725378365a44665337307337754d486842705225324659423573305057366f455270316236253246667252684b3353444c35546965364f515548516c5133735644752532427a50636b397657453973747225324236496a533967486d5750616861444a25324277434b364e494242587348423948796b587378774470686c436d416476706c6162554a4e6e5a504239342532464e7436784f6538587a4562503257684d335741673147756236744825324233513150673337365239713475716c6e6f36676448476a444f5139306562303141484d3672596975554a314f713472344656756a35765239427a4d3957674e764f7977446869495951467667626366774166774d764863615067425041253246447948476a50624e394138616d6562636477416444354e6633373574787165774e5552656f797677424958594c645170576c6877465771745061435044334173467541535636717171496c62304a766b564331464c39576b4c55556c55574b337a585a4c46432532423125324642726f46746f364f7358497545594a5034447a7a5732594656316f4a614141414141456c46546b5375516d4343\" alt=\"license\" data-canonical-src=\"https://img.shields.io/github/license/moby/buildkit?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD3klEQVR4nO3YSUzUUBgH8JroWVrUGJfEm7sXNcSDFxMTL2pi4sHEgxeNRowXgpEWBDURR%2BNANOKOK66ooKJGBXeEGRcWAcEVFGQRHFwQmH5%2F0wHaeWHI9DUDU5L5knehdOb7zfe%2B19cnCJGIRCQiEYlQB7YJIyGL8aosulVZ6iRFQjiGKkudWg5aLlpOppNXnfPqw5U0DYRJmVxjCgFF3BLuZGmAoVUiKEArmX7D7USgsQporgGa3gHfK4H6cuBbCVD3Gqh1A5%2BLgE%2BFwIenQM0joDofqLoHVNwBym8CpTnAm2zQq0sgdxbIdQZUlAkqPAZ6dgj05ADoYRoofy%2FoXiro7k5QXjLopgzKiQNlLDaqoIguEwBjzqP5PfDjE9DyIXyI63FMTwQFMCVrqwNav4QfoRg58QF%2BfrMHQrEK8DToCMqNAyWNHfxmTRoLOrmSRVgGtDfqCEqZOHQrzo4pbCUsA3416Qi6EQ9KGjcEFRgHOrOKnU6WAb9bGETYekKxCvjTag9E4pje54Dk5QP8bbMHYv%2FC3ueAeJkP0OGxB%2BJpBnArYR8EYQQnoN1ANFaBnPP5l8SrseYQL06Adk0FJY8HOWaBMleAHjh0hPosIzlo8v0A%2F34ZiOeHra0qKRPMVSI7tv%2B92tw%2FvhxUeBRq4VELgM7fBqK5GpRmoQLXNpubTu6zoNRpgT8nPQbq84wd%2FICuvyxiKHqiNAfI3wM6uIhBqGkLiiwAOsKDqOht7Itr9Vy8SjRBEWfyAbr%2FhR1BfpVQFdHJB%2FB2hh7x7j6QpwCVeeYQ2krUB5Clcj6A2m0gWj%2BD0mL49zW5cQyCHLN7rjlmmatEyXX%2FCrTzA%2FoQxZkWl9GJTCVo%2ByTj87%2B4giPKcv0qIHo4AV4D0VZrrQI34pnpRM65xue%2FzAreE4%2FT%2FSoglfEByMsiQtATlL3RAJ5YHrSx6ZDfS70s7uMHhBpR%2FYB5s0PW6oERp1b6%2FfrRhK3SDL5Tie6OQUHQlQ3sVDu%2BzPck9vWE9str%2B6IjS9gHmWPahaDJ%2BwCK6NIBBXsHB9HykXsxwDphlCmAdvplabUJNnZPB94%2FNt6xOe8XzEbP2WhM3WAg1Gub6tH%2B3Q1Pg376R9q4uqlno6gdHGjDOQ90eb01AHM6rYiuUJ1Oq4r4FVuj5vR9BzM9WgNvOywDhiIYQFvgbcfwAfwMvHcaPgBPA%2FDyHGjPbN9A8amebcdwAdD5Nf375txqewNUReoyvwBIXYLdQpWlhwFWqtPaCPD3AsFuASV6qqqIlb0JvkVC1FL9WkLUUlUWK3zXZLFC%2B1%2FBroFto6OsXIuEYJP4DzzW2YFV1oJaAAAAAElFTkSuQmCC\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/05287bd911df41fbe18a32b305736c73a77e23ae57fb6e3d0a8ac9d8d6e4e582/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d6f62792f6275696c646b69743f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/moby/buildkit?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/5ebc5821a00527f624de9eaf40f6593205eddca1b2e66d19c414094da5d8b56c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f6d6f62792f6275696c646b69743f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/moby/buildkit?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<p dir=\"auto\"><a href=\"https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/1902755ab22157de1223410b7c9eab5314226ab9517777fa67d33811290fc2b0/68747470733a2f2f61736369696e656d612e6f72672f612f67504549456f314e7a6d44545575326245507355626f716d552e706e67\" alt=\"asciicinema example\" data-canonical-src=\"https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU.png\" style=\"max-width: 100%;\"></a></p>\n<h1 dir=\"auto\">BuildKit </h1>\n<p dir=\"auto\"><a href=\"https://github.com/moby/buildkit/releases/latest\"><img src=\"https://camo.githubusercontent.com/8301b1c4eb7e9e4d400fc3dae90bdbbd1982692dd767b99954b0a801eb410fe3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d6f62792f6275696c646b69742e7376673f7374796c653d666c61742d737175617265\" alt=\"GitHub Release\" data-canonical-src=\"https://img.shields.io/github/release/moby/buildkit.svg?style=flat-square\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://pkg.go.dev/github.com/moby/buildkit/client/llb\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/6cb81ff37edfc7f25db77898190cd1b88fbdb215ddab09de8b0340d24a311a49/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f676f2e6465762d646f63732d3030376439633f7374796c653d666c61742d737175617265266c6f676f3d676f266c6f676f436f6c6f723d7768697465\" alt=\"PkgGoDev\" data-canonical-src=\"https://img.shields.io/badge/go.dev-docs-007d9c?style=flat-square&amp;logo=go&amp;logoColor=white\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://github.com/moby/buildkit/actions?query=workflow%3Abuildkit\"><img src=\"https://camo.githubusercontent.com/818b1a54062dd2e2d4e7f6efd6f6391d3a067765805e3ebf2e7538e7d91aad39/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f62792f6275696c646b69742f6275696c646b69742e796d6c3f6c6162656c3d6275696c646b6974266c6f676f3d676974687562267374796c653d666c61742d737175617265\" alt=\"CI BuildKit Status\" data-canonical-src=\"https://img.shields.io/github/actions/workflow/status/moby/buildkit/buildkit.yml?label=buildkit&amp;logo=github&amp;style=flat-square\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://github.com/moby/buildkit/actions?query=workflow%3Afrontend\"><img src=\"https://camo.githubusercontent.com/026147b7552d292eaee4de07aecec937ddaa14036d9a4e9a9a1ae14141eed8f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d6f62792f6275696c646b69742f66726f6e74656e642e796d6c3f6c6162656c3d66726f6e74656e64266c6f676f3d676974687562267374796c653d666c61742d737175617265\" alt=\"CI Frontend Status\" data-canonical-src=\"https://img.shields.io/github/actions/workflow/status/moby/buildkit/frontend.yml?label=frontend&amp;logo=github&amp;style=flat-square\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://goreportcard.com/report/github.com/moby/buildkit\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/25537bd5a4e14e2a61ced79f05d86b0d330daa425dc1845f68f08cfaad235f2e/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f6d6f62792f6275696c646b69743f7374796c653d666c61742d737175617265\" alt=\"Go Report Card\" data-canonical-src=\"https://goreportcard.com/badge/github.com/moby/buildkit?style=flat-square\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://codecov.io/gh/moby/buildkit\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/54fd843841feb62e6df9b6e5601e28bbdb0d2f2a96fe6b8e0b560f82c1001132/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d6f62792f6275696c646b69743f6c6f676f3d636f6465636f76267374796c653d666c61742d737175617265\" alt=\"Codecov\" data-canonical-src=\"https://img.shields.io/codecov/c/github/moby/buildkit?logo=codecov&amp;style=flat-square\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner.</p>\n<p dir=\"auto\">Key features:</p>\n<ul dir=\"auto\">\n<li>Automatic garbage collection</li>\n<li>Extendable frontend formats</li>\n<li>Concurrent dependency resolution</li>\n<li>Efficient instruction caching</li>\n<li>Build cache import/export</li>\n<li>Nested build job invocations</li>\n<li>Distributable workers</li>\n<li>Multiple output formats</li>\n<li>Pluggable architecture</li>\n<li>Execution without root privileges</li>\n</ul>\n<p dir=\"auto\">Read the proposal from <a class=\"issue-link js-issue-link\" data-error-text=\"Failed to load title\" data-id=\"225189862\" data-permission-text=\"Title is private\" data-url=\"https://github.com/moby/moby/issues/32925\" data-hovercard-type=\"issue\" data-hovercard-url=\"/moby/moby/issues/32925/hovercard\" href=\"https://github.com/moby/moby/issues/32925\">moby/moby#32925</a></p>\n<p dir=\"auto\">Introductory blog post <a href=\"https://blog.mobyproject.org/introducing-buildkit-17e056cc5317\" rel=\"nofollow\">https://blog.mobyproject.org/introducing-buildkit-17e056cc5317</a></p>\n<p dir=\"auto\">Join <code class=\"notranslate\">#buildkit</code> channel on <a href=\"https://dockr.ly/comm-slack\" rel=\"nofollow\">Docker Community Slack</a></p>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">If you are visiting this repo for the usage of BuildKit-only Dockerfile features<br>\nlike <code class=\"notranslate\">RUN --mount=type=(bind|cache|tmpfs|secret|ssh)</code>, please refer to the<br>\n<a href=\"https://docs.docker.com/engine/reference/builder/\" rel=\"nofollow\">Dockerfile reference</a>.</p>\n</div>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\"><code class=\"notranslate\">docker build</code> <a href=\"https://docs.docker.com/build/architecture/\" rel=\"nofollow\">uses Buildx and BuildKit by default</a> since Docker Engine 23.0.<br>\nYou don't need to read this document unless you want to use the full-featured<br>\nstandalone version of BuildKit.</p>\n</div>\n\n\n<ul dir=\"auto\">\n<li><a href=\"#used-by\">Used by</a></li>\n<li><a href=\"#quick-start\">Quick start</a>\n<ul dir=\"auto\">\n<li><a href=\"#linux-setup\">Linux Setup</a></li>\n<li><a href=\"#windows-setup\">Windows Setup</a></li>\n<li><a href=\"#macos-setup\">macOS Setup</a></li>\n<li><a href=\"#build-from-source\">Build from source</a></li>\n<li><a href=\"#exploring-llb\">Exploring LLB</a></li>\n<li><a href=\"#exploring-dockerfiles\">Exploring Dockerfiles</a>\n<ul dir=\"auto\">\n<li><a href=\"#building-a-dockerfile-with-buildctl\">Building a Dockerfile with <code class=\"notranslate\">buildctl</code></a></li>\n<li><a href=\"#building-a-dockerfile-using-external-frontend\">Building a Dockerfile using external frontend</a></li>\n</ul>\n</li>\n<li><a href=\"#output\">Output</a>\n<ul dir=\"auto\">\n<li><a href=\"#imageregistry\">Image/Registry</a></li>\n<li><a href=\"#local-directory\">Local directory</a></li>\n<li><a href=\"#docker-tarball\">Docker tarball</a></li>\n<li><a href=\"#oci-tarball\">OCI tarball</a></li>\n<li><a href=\"#containerd-image-store\">containerd image store</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"#cache\">Cache</a>\n<ul dir=\"auto\">\n<li><a href=\"#garbage-collection\">Garbage collection</a></li>\n<li><a href=\"#export-cache\">Export cache</a>\n<ul dir=\"auto\">\n<li><a href=\"#inline-push-image-and-cache-together\">Inline (push image and cache together)</a></li>\n<li><a href=\"#registry-push-image-and-cache-separately\">Registry (push image and cache separately)</a></li>\n<li><a href=\"#local-directory-1\">Local directory</a></li>\n<li><a href=\"#github-actions-cache-experimental\">GitHub Actions cache (experimental)</a></li>\n<li><a href=\"#s3-cache-experimental\">S3 cache (experimental)</a></li>\n<li><a href=\"#azure-blob-storage-cache-experimental\">Azure Blob Storage cache (experimental)</a></li>\n</ul>\n</li>\n<li><a href=\"#consistent-hashing\">Consistent hashing</a></li>\n</ul>\n</li>\n<li><a href=\"#metadata\">Metadata</a></li>\n<li><a href=\"#systemd-socket-activation\">Systemd socket activation</a></li>\n<li><a href=\"#expose-buildkit-as-a-tcp-service\">Expose BuildKit as a TCP service</a>\n<ul dir=\"auto\">\n<li><a href=\"#load-balancing\">Load balancing</a></li>\n</ul>\n</li>\n<li><a href=\"#containerizing-buildkit\">Containerizing BuildKit</a>\n<ul dir=\"auto\">\n<li><a href=\"#podman\">Podman</a></li>\n<li><a href=\"#nerdctl\">Nerdctl</a></li>\n<li><a href=\"#kubernetes\">Kubernetes</a></li>\n<li><a href=\"#daemonless\">Daemonless</a></li>\n</ul>\n</li>\n<li><a href=\"#opentelemetry-support\">OpenTelemetry support</a></li>\n<li><a href=\"#running-buildkit-without-root-privileges\">Running BuildKit without root privileges</a></li>\n<li><a href=\"#building-multi-platform-images\">Building multi-platform images</a>\n<ul dir=\"auto\">\n<li><a href=\"#configuring-buildctl\">Configuring <code class=\"notranslate\">buildctl</code></a>\n<ul dir=\"auto\">\n<li><a href=\"#color-output-controls\">Color Output Controls</a></li>\n<li><a href=\"#number-of-log-lines-for-active-steps-in-tty-mode\">Number of log lines (for active steps in tty mode)</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li><a href=\"#contributing\">Contributing</a></li>\n</ul>\n\n<h2 dir=\"auto\">Used by</h2>\n<p dir=\"auto\">BuildKit is used by the following projects:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/moby/moby/pull/37151\" data-hovercard-type=\"pull_request\" data-hovercard-url=\"/moby/moby/pull/37151/hovercard\">Moby &amp; Docker</a> (<code class=\"notranslate\">DOCKER_BUILDKIT=1 docker build</code>)</li>\n<li><a href=\"https://github.com/genuinetools/img\">img</a></li>\n<li><a href=\"https://github.com/openfaas/openfaas-cloud\">OpenFaaS Cloud</a></li>\n<li><a href=\"https://github.com/containerbuilding/cbi\">container build interface</a></li>\n<li><a href=\"https://github.com/tektoncd/catalog\">Tekton Pipelines</a> (formerly <a href=\"https://github.com/knative/build-templates\">Knative Build Templates</a>)</li>\n<li><a href=\"https://github.com/distributed-containers-inc/sanic\">the Sanic build tool</a></li>\n<li><a href=\"https://github.com/stellarproject/vab\">vab</a></li>\n<li><a href=\"https://github.com/rancher/rio\">Rio</a></li>\n<li><a href=\"https://github.com/rancher/kim\">kim</a></li>\n<li><a href=\"https://github.com/alibaba/pouch\">PouchContainer</a></li>\n<li><a href=\"https://github.com/docker/buildx\">Docker buildx</a></li>\n<li><a href=\"https://okteto.com/\" rel=\"nofollow\">Okteto Cloud</a></li>\n<li><a href=\"https://github.com/vladaionescu/earthly\">Earthly earthfiles</a></li>\n<li><a href=\"https://github.com/gitpod-io/gitpod\">Gitpod</a></li>\n<li><a href=\"https://dagger.io\" rel=\"nofollow\">Dagger</a></li>\n<li><a href=\"https://github.com/tensorchord/envd/\">envd</a></li>\n<li><a href=\"https://depot.dev\" rel=\"nofollow\">Depot</a></li>\n<li><a href=\"https://namespace.so\" rel=\"nofollow\">Namespace</a></li>\n<li><a href=\"https://unikraft.org\" rel=\"nofollow\">Unikraft</a></li>\n<li><a href=\"https://devzero.io\" rel=\"nofollow\">DevZero</a></li>\n<li><a href=\"https://github.com/r2d4/dacc\">dacc</a></li>\n</ul>\n<h2 dir=\"auto\">Quick start</h2>\n<p dir=\"auto\">ℹ️ For Kubernetes deployments, see <a href=\"./examples/kubernetes\"><code class=\"notranslate\">examples/kubernetes</code></a>.</p>\n<p dir=\"auto\">BuildKit is composed of the <code class=\"notranslate\">buildkitd</code> daemon and the <code class=\"notranslate\">buildctl</code> client.<br>\nWhile the <code class=\"notranslate\">buildctl</code> client is available for Linux, macOS, and Windows, the <code class=\"notranslate\">buildkitd</code> daemon is only available for Linux and *Windows currently.</p>\n<p dir=\"auto\">The latest binaries of BuildKit are available <a href=\"https://github.com/moby/buildkit/releases\">here</a> for Linux, macOS, and Windows.</p>\n<h3 dir=\"auto\">Linux Setup</h3>\n<p dir=\"auto\">The <code class=\"notranslate\">buildkitd</code> daemon requires the following components to be installed:</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/opencontainers/runc\">runc</a> or <a href=\"https://github.com/containers/crun\">crun</a></li>\n<li><a href=\"https://github.com/containerd/containerd\">containerd</a> (if you want to use containerd worker)</li>\n</ul>\n<p dir=\"auto\"><strong>Starting the <code class=\"notranslate\">buildkitd</code> daemon:</strong><br>\nYou need to run <code class=\"notranslate\">buildkitd</code> as the root user on the host.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ sudo buildkitd\"><pre class=\"notranslate\">$ sudo buildkitd</pre></div>\n<p dir=\"auto\">To run <code class=\"notranslate\">buildkitd</code> as a non-root user, see <a href=\"docs/rootless.md\"><code class=\"notranslate\">docs/rootless.md</code></a>.</p>\n<p dir=\"auto\">The buildkitd daemon supports two worker backends: OCI (runc) and containerd.</p>\n<p dir=\"auto\">By default, the OCI (runc) worker is used. You can set <code class=\"notranslate\">--oci-worker=false --containerd-worker=true</code> to use the containerd worker.</p>\n<p dir=\"auto\">We are open to adding more backends.</p>\n<p dir=\"auto\">To start the buildkitd daemon using systemd socket activation, you can install the buildkit systemd unit files.<br>\nSee <a href=\"#systemd-socket-activation\">Systemd socket activation</a></p>\n<p dir=\"auto\">The buildkitd daemon listens gRPC API on <code class=\"notranslate\">/run/buildkit/buildkitd.sock</code> by default, but you can also use TCP sockets.<br>\nSee <a href=\"#expose-buildkit-as-a-tcp-service\">Expose BuildKit as a TCP service</a>.</p>\n<h3 dir=\"auto\">Windows Setup</h3>\n<p dir=\"auto\">See instructions and notes at <a href=\"./docs/windows.md\"><code class=\"notranslate\">docs/windows.md</code></a>.</p>\n<h3 dir=\"auto\">macOS Setup</h3>\n<p dir=\"auto\"><a href=\"https://formulae.brew.sh/formula/buildkit\" rel=\"nofollow\">Homebrew formula</a> (unofficial) is available for macOS.</p>\n<div class=\"highlight highlight-text-shell-session notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ brew install buildkit\"><pre class=\"notranslate\">$ <span class=\"pl-s1\">brew install buildkit</span></pre></div>\n<p dir=\"auto\">The Homebrew formula does not contain the daemon (<code class=\"notranslate\">buildkitd</code>).</p>\n<p dir=\"auto\">For example, <a href=\"https://lima-vm.io\" rel=\"nofollow\">Lima</a> can be used for launching the daemon inside a Linux VM.</p>\n<div class=\"highlight highlight-text-shell-session notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"brew install lima\nlimactl start template://buildkit\nexport BUILDKIT_HOST=&quot;unix://$HOME/.lima/buildkit/sock/buildkitd.sock&quot;\"><pre class=\"notranslate\"><span class=\"pl-c1\">brew install lima</span>\n<span class=\"pl-c1\">limactl start template://buildkit</span>\n<span class=\"pl-c1\">export BUILDKIT_HOST=\"unix://$HOME/.lima/buildkit/sock/buildkitd.sock\"</span></pre></div>\n<h3 dir=\"auto\">Build from source</h3>\n<p dir=\"auto\">To build BuildKit from source, see <a href=\"./.github/CONTRIBUTING.md\"><code class=\"notranslate\">.github/CONTRIBUTING.md</code></a>.</p>\n<p dir=\"auto\">For a <code class=\"notranslate\">buildctl</code> reference, see <a href=\"./docs/reference/buildctl.md\">this document</a>.</p>\n<h3 dir=\"auto\">Exploring LLB</h3>\n<p dir=\"auto\">BuildKit builds are based on a binary intermediate format called LLB that is used for defining the dependency graph for processes running part of your build. tl;dr: LLB is to Dockerfile what LLVM IR is to C.</p>\n<ul dir=\"auto\">\n<li>Marshaled as Protobuf messages</li>\n<li>Concurrently executable</li>\n<li>Efficiently cacheable</li>\n<li>Vendor-neutral (i.e. non-Dockerfile languages can be easily implemented)</li>\n</ul>\n<p dir=\"auto\">See <a href=\"./solver/pb/ops.proto\"><code class=\"notranslate\">solver/pb/ops.proto</code></a> for the format definition, and see <a href=\"./examples/README.md\"><code class=\"notranslate\">./examples/README.md</code></a> for example LLB applications.</p>\n<p dir=\"auto\">Currently, the following high-level languages have been implemented for LLB:</p>\n<ul dir=\"auto\">\n<li>Dockerfile (See <a href=\"#exploring-dockerfiles\">Exploring Dockerfiles</a>)</li>\n<li><a href=\"https://github.com/tonistiigi/buildkit-pack\">Buildpacks</a></li>\n<li><a href=\"https://matt-rickard.com/building-a-new-dockerfile-frontend/\" rel=\"nofollow\">Mockerfile</a></li>\n<li><a href=\"https://github.com/po3rin/gockerfile\">Gockerfile</a></li>\n<li><a href=\"https://github.com/talos-systems/bldr/\">bldr (Pkgfile)</a></li>\n<li><a href=\"https://github.com/openllb/hlb\">HLB</a></li>\n<li><a href=\"https://github.com/earthly/earthly\">Earthfile (Earthly)</a></li>\n<li><a href=\"https://github.com/denzp/cargo-wharf\">Cargo Wharf (Rust)</a></li>\n<li><a href=\"https://github.com/reproducible-containers/buildkit-nix\">Nix</a></li>\n<li><a href=\"https://github.com/cmdjulian/mopy\">mopy (Python)</a></li>\n<li><a href=\"https://github.com/tensorchord/envd/\">envd (starlark)</a></li>\n<li><a href=\"https://gitlab.wikimedia.org/repos/releng/blubber\" rel=\"nofollow\">Blubber</a></li>\n<li><a href=\"https://github.com/vito/bass\">Bass</a></li>\n<li><a href=\"https://github.com/unikraft/kraftkit/tree/staging/tools/dockerfile-llb-frontend\">kraft.yaml (Unikraft)</a></li>\n<li><a href=\"https://github.com/r2d4/llb\">r2d4/llb (JSON Gateway)</a></li>\n<li>(open a PR to add your own language)</li>\n</ul>\n<h3 dir=\"auto\">Exploring Dockerfiles</h3>\n<p dir=\"auto\">Frontends are components that run inside BuildKit and convert any build definition to LLB. There is a special frontend called gateway (<code class=\"notranslate\">gateway.v0</code>) that allows using any image as a frontend.</p>\n<p dir=\"auto\">During development, Dockerfile frontend (<code class=\"notranslate\">dockerfile.v0</code>) is also part of the BuildKit repo. In the future, this will be moved out, and Dockerfiles can be built using an external image.</p>\n<h4 dir=\"auto\">Building a Dockerfile with <code class=\"notranslate\">buildctl</code></h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=.\n# or\nbuildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=. \\\n    --opt target=foo \\\n    --opt build-arg:foo=bar\"><pre class=\"notranslate\">buildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=.\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> or</span>\nbuildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=. \\\n    --opt target=foo \\\n    --opt build-arg:foo=bar</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">--local</code> exposes local source files from client to the builder. <code class=\"notranslate\">context</code> and <code class=\"notranslate\">dockerfile</code> are the names Dockerfile frontend looks for build context and Dockerfile location.</p>\n<p dir=\"auto\">If the Dockerfile has a different filename it can be specified with <code class=\"notranslate\">--opt filename=./Dockerfile-alternative</code>.</p>\n<h4 dir=\"auto\">Building a Dockerfile using external frontend</h4>\n<p dir=\"auto\">External versions of the Dockerfile frontend are pushed to <a href=\"https://hub.docker.com/r/docker/dockerfile-upstream\" rel=\"nofollow\">https://hub.docker.com/r/docker/dockerfile-upstream</a> and <a href=\"https://hub.docker.com/r/docker/dockerfile\" rel=\"nofollow\">https://hub.docker.com/r/docker/dockerfile</a> and can be used with the gateway frontend. The source for the external frontend is currently located in <code class=\"notranslate\">./frontend/dockerfile/cmd/dockerfile-frontend</code> but will move out of this repository in the future (<a href=\"https://github.com/moby/buildkit/issues/163\" data-hovercard-type=\"issue\" data-hovercard-url=\"/moby/buildkit/issues/163/hovercard\">#163</a>). For automatic build from master branch of this repository <code class=\"notranslate\">docker/dockerfile-upstream:master</code> or <code class=\"notranslate\">docker/dockerfile-upstream:master-labs</code> image can be used.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --local context=. \\\n    --local dockerfile=.\nbuildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --opt context=https://github.com/moby/moby.git \\\n    --opt build-arg:APT_MIRROR=cdn-fastly.deb.debian.org\"><pre class=\"notranslate\">buildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --local context=. \\\n    --local dockerfile=.\nbuildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --opt context=https://github.com/moby/moby.git \\\n    --opt build-arg:APT_MIRROR=cdn-fastly.deb.debian.org</pre></div>\n<h3 dir=\"auto\">Output</h3>\n<p dir=\"auto\">By default, the build result and intermediate cache will only remain internally in BuildKit. An output needs to be specified to retrieve the result.</p>\n<h4 dir=\"auto\">Image/Registry</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=image,name=docker.io/username/image,push=true\"><pre class=\"notranslate\">buildctl build ... --output type=image,name=docker.io/username/image,push=true</pre></div>\n<p dir=\"auto\">To export the image to multiple registries:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=image,\\&quot;name=docker.io/username/image,docker.io/username2/image2\\&quot;,push=true\"><pre class=\"notranslate\">buildctl build ... --output type=image,<span class=\"pl-cce\">\\\"</span>name=docker.io/username/image,docker.io/username2/image2<span class=\"pl-cce\">\\\"</span>,push=true</pre></div>\n<p dir=\"auto\">To export the cache embed with the image and pushing them to registry together, type <code class=\"notranslate\">registry</code> is required to import the cache, you should specify <code class=\"notranslate\">--export-cache type=inline</code> and <code class=\"notranslate\">--import-cache type=registry,ref=...</code>. To export the cache to a local directly, you should specify <code class=\"notranslate\">--export-cache type=local</code>.<br>\nDetails in <a href=\"#export-cache\">Export cache</a>.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ...\\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image\"><pre class=\"notranslate\">buildctl build ...\\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image</pre></div>\n<p dir=\"auto\">Keys supported by image output:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">name=&lt;value&gt;</code>: specify image name(s)</li>\n<li><code class=\"notranslate\">push=true</code>: push after creating the image</li>\n<li><code class=\"notranslate\">push-by-digest=true</code>: push unnamed image</li>\n<li><code class=\"notranslate\">registry.insecure=true</code>: push to insecure HTTP registry</li>\n<li><code class=\"notranslate\">oci-mediatypes=true</code>: use OCI mediatypes in configuration JSON instead of Docker's</li>\n<li><code class=\"notranslate\">oci-artifact=false</code>: use OCI artifact format for attestations</li>\n<li><code class=\"notranslate\">unpack=true</code>: unpack image after creation (for use with containerd)</li>\n<li><code class=\"notranslate\">dangling-name-prefix=&lt;value&gt;</code>: name image with <code class=\"notranslate\">prefix@&lt;digest&gt;</code>, used for anonymous images</li>\n<li><code class=\"notranslate\">name-canonical=true</code>: add additional canonical name <code class=\"notranslate\">name@&lt;digest&gt;</code></li>\n<li><code class=\"notranslate\">compression=&lt;uncompressed|gzip|estargz|zstd&gt;</code>: choose compression type for layers newly created and cached, gzip is default value. estargz should be used with <code class=\"notranslate\">oci-mediatypes=true</code>.</li>\n<li><code class=\"notranslate\">compression-level=&lt;value&gt;</code>: compression level for gzip, estargz (0-9) and zstd (0-22)</li>\n<li><code class=\"notranslate\">rewrite-timestamp=true</code>: rewrite the file timestamps to the <code class=\"notranslate\">SOURCE_DATE_EPOCH</code> value.<br>\nSee <a href=\"docs/build-repro.md\"><code class=\"notranslate\">docs/build-repro.md</code></a> for how to specify the <code class=\"notranslate\">SOURCE_DATE_EPOCH</code> value.</li>\n<li><code class=\"notranslate\">force-compression=true</code>: forcefully apply <code class=\"notranslate\">compression</code> option to all layers (including already existing layers)</li>\n<li><code class=\"notranslate\">store=true</code>: store the result images to the worker's (e.g. containerd) image store as well as ensures that the image has all blobs in the content store (default <code class=\"notranslate\">true</code>). Ignored if the worker doesn't have image store (e.g. OCI worker).</li>\n<li><code class=\"notranslate\">annotation.&lt;key&gt;=&lt;value&gt;</code>: attach an annotation with the respective <code class=\"notranslate\">key</code> and <code class=\"notranslate\">value</code> to the built image\n<ul dir=\"auto\">\n<li>Using the extended syntaxes, <code class=\"notranslate\">annotation-&lt;type&gt;.&lt;key&gt;=&lt;value&gt;</code>, <code class=\"notranslate\">annotation[&lt;platform&gt;].&lt;key&gt;=&lt;value&gt;</code> and both combined with <code class=\"notranslate\">annotation-&lt;type&gt;[&lt;platform&gt;].&lt;key&gt;=&lt;value&gt;</code>, allows configuring exactly where to attach the annotation.</li>\n<li><code class=\"notranslate\">&lt;type&gt;</code> specifies what object to attach to, and can be any of <code class=\"notranslate\">manifest</code> (the default), <code class=\"notranslate\">manifest-descriptor</code>, <code class=\"notranslate\">index</code> and <code class=\"notranslate\">index-descriptor</code></li>\n<li><code class=\"notranslate\">&lt;platform&gt;</code> specifies which objects to attach to (by default, all), and is the same key passed into the <code class=\"notranslate\">platform</code> opt, see <a href=\"docs/multi-platform.md\"><code class=\"notranslate\">docs/multi-platform.md</code></a>.</li>\n<li>See <a href=\"docs/annotations.md\"><code class=\"notranslate\">docs/annotations.md</code></a> for more details.</li>\n</ul>\n</li>\n</ul>\n<p dir=\"auto\">If credentials are required, <code class=\"notranslate\">buildctl</code> will attempt to read Docker configuration file <code class=\"notranslate\">$DOCKER_CONFIG/config.json</code>.<br>\n<code class=\"notranslate\">$DOCKER_CONFIG</code> defaults to <code class=\"notranslate\">~/.docker</code>.</p>\n<h4 dir=\"auto\">Local directory</h4>\n<p dir=\"auto\">The local client will copy the files directly to the client. This is useful if BuildKit is being used for building something else than container images.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=local,dest=path/to/output-dir\"><pre class=\"notranslate\">buildctl build ... --output type=local,dest=path/to/output-dir</pre></div>\n<p dir=\"auto\">To export specific files use multi-stage builds with a scratch stage and copy the needed files into that stage with <code class=\"notranslate\">COPY --from</code>.</p>\n<div class=\"highlight highlight-source-dockerfile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"...\nFROM scratch as testresult\n\nCOPY --from=builder /usr/src/app/testresult.xml .\n...\"><pre class=\"notranslate\">...\n<span class=\"pl-k\">FROM</span> scratch as testresult\n\n<span class=\"pl-k\">COPY</span> --from=builder /usr/src/app/testresult.xml .\n...</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --opt target=testresult --output type=local,dest=path/to/output-dir\"><pre class=\"notranslate\">buildctl build ... --opt target=testresult --output type=local,dest=path/to/output-dir</pre></div>\n<p dir=\"auto\">With a <a href=\"docs/multi-platform.md\">multi-platform build</a>, a subfolder matching<br>\neach target platform will be created in the destination directory:</p>\n<div class=\"highlight highlight-source-dockerfile notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"FROM busybox AS build\nARG TARGETOS\nARG TARGETARCH\nRUN mkdir /out &amp;&amp; echo foo &gt; /out/hello-$TARGETOS-$TARGETARCH\n\nFROM scratch\nCOPY --from=build /out /\"><pre class=\"notranslate\"><span class=\"pl-k\">FROM</span> busybox AS build\n<span class=\"pl-k\">ARG</span> TARGETOS\n<span class=\"pl-k\">ARG</span> TARGETARCH\n<span class=\"pl-k\">RUN</span> mkdir /out &amp;&amp; echo foo &gt; /out/hello-$TARGETOS-$TARGETARCH\n\n<span class=\"pl-k\">FROM</span> scratch\n<span class=\"pl-k\">COPY</span> --from=build /out /</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ buildctl build \\\n  --frontend dockerfile.v0 \\\n  --opt platform=linux/amd64,linux/arm64 \\\n  --output type=local,dest=./bin/release\n\n$ tree ./bin\n./bin/\n└── release\n    ├── linux_amd64\n    │   └── hello-linux-amd64\n    └── linux_arm64\n        └── hello-linux-arm64\"><pre class=\"notranslate\">$ buildctl build \\\n  --frontend dockerfile.v0 \\\n  --opt platform=linux/amd64,linux/arm64 \\\n  --output type=local,dest=./bin/release\n\n$ tree ./bin\n./bin/\n└── release\n    ├── linux_amd64\n    │   └── hello-linux-amd64\n    └── linux_arm64\n        └── hello-linux-arm64</pre></div>\n<p dir=\"auto\">You can set <code class=\"notranslate\">platform-split=false</code> to merge files from all platforms together<br>\ninto same directory:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"$ buildctl build \\\n  --frontend dockerfile.v0 \\\n  --opt platform=linux/amd64,linux/arm64 \\\n  --output type=local,dest=./bin/release,platform-split=false\n\n$ tree ./bin\n./bin/\n└── release\n    ├── hello-linux-amd64\n    └── hello-linux-arm64\"><pre class=\"notranslate\">$ buildctl build \\\n  --frontend dockerfile.v0 \\\n  --opt platform=linux/amd64,linux/arm64 \\\n  --output type=local,dest=./bin/release,platform-split=false\n\n$ tree ./bin\n./bin/\n└── release\n    ├── hello-linux-amd64\n    └── hello-linux-arm64</pre></div>\n<p dir=\"auto\">Tar exporter is similar to local exporter but transfers the files through a tarball.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=tar,dest=out.tar\nbuildctl build ... --output type=tar &gt; out.tar\"><pre class=\"notranslate\">buildctl build ... --output type=tar,dest=out.tar\nbuildctl build ... --output type=tar <span class=\"pl-k\">&gt;</span> out.tar</pre></div>\n<h4 dir=\"auto\">Docker tarball</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# exported tarball is also compatible with OCI spec\nbuildctl build ... --output type=docker,name=myimage | docker load\"><pre class=\"notranslate\"><span class=\"pl-c\"><span class=\"pl-c\">#</span> exported tarball is also compatible with OCI spec</span>\nbuildctl build ... --output type=docker,name=myimage <span class=\"pl-k\">|</span> docker load</pre></div>\n<h4 dir=\"auto\">OCI tarball</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=oci,dest=path/to/output.tar\nbuildctl build ... --output type=oci &gt; output.tar\"><pre class=\"notranslate\">buildctl build ... --output type=oci,dest=path/to/output.tar\nbuildctl build ... --output type=oci <span class=\"pl-k\">&gt;</span> output.tar</pre></div>\n<h4 dir=\"auto\">containerd image store</h4>\n<p dir=\"auto\">The containerd worker needs to be used</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --output type=image,name=docker.io/username/image\nctr --namespace=buildkit images ls\"><pre class=\"notranslate\">buildctl build ... --output type=image,name=docker.io/username/image\nctr --namespace=buildkit images ls</pre></div>\n<p dir=\"auto\">To change the containerd namespace, you need to change <code class=\"notranslate\">worker.containerd.namespace</code> in <a href=\"./docs/buildkitd.toml.md\"><code class=\"notranslate\">/etc/buildkit/buildkitd.toml</code></a>.</p>\n<h2 dir=\"auto\">Cache</h2>\n<p dir=\"auto\">To show local build cache (<code class=\"notranslate\">/var/lib/buildkit</code>):</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl du -v\"><pre class=\"notranslate\">buildctl du -v</pre></div>\n<p dir=\"auto\">To prune local build cache:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl prune\"><pre class=\"notranslate\">buildctl prune</pre></div>\n<h3 dir=\"auto\">Garbage collection</h3>\n<p dir=\"auto\">See <a href=\"./docs/buildkitd.toml.md\"><code class=\"notranslate\">./docs/buildkitd.toml.md</code></a>.</p>\n<h3 dir=\"auto\">Export cache</h3>\n<p dir=\"auto\">BuildKit supports the following cache exporters:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">inline</code>: embed the cache into the image, and push them to the registry together</li>\n<li><code class=\"notranslate\">registry</code>: push the image and the cache separately</li>\n<li><code class=\"notranslate\">local</code>: export to a local directory</li>\n<li><code class=\"notranslate\">gha</code>: export to GitHub Actions cache</li>\n</ul>\n<p dir=\"auto\">In most case you want to use the <code class=\"notranslate\">inline</code> cache exporter.<br>\nHowever, note that the <code class=\"notranslate\">inline</code> cache exporter only supports <code class=\"notranslate\">min</code> cache mode.<br>\nTo enable <code class=\"notranslate\">max</code> cache mode, push the image and the cache separately by using <code class=\"notranslate\">registry</code> cache exporter.</p>\n<p dir=\"auto\"><code class=\"notranslate\">inline</code> and <code class=\"notranslate\">registry</code> exporters both store the cache in the registry. For importing the cache, <code class=\"notranslate\">type=registry</code> is sufficient for both, as specifying the cache format is not necessary.</p>\n<h4 dir=\"auto\">Inline (push image and cache together)</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image\"><pre class=\"notranslate\">buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image</pre></div>\n<p dir=\"auto\">Note that the inline cache is not imported unless <a href=\"#registry-push-image-and-cache-separately\"><code class=\"notranslate\">--import-cache type=registry,ref=...</code></a> is provided.</p>\n<p dir=\"auto\">Inline cache embeds cache metadata into the image config. The layers in the image will be left untouched compared to the image with no cache information.</p>\n<p dir=\"auto\">ℹ️ Docker-integrated BuildKit (<code class=\"notranslate\">DOCKER_BUILDKIT=1 docker build</code>) and <code class=\"notranslate\">docker buildx</code>requires<br>\n<code class=\"notranslate\">--build-arg BUILDKIT_INLINE_CACHE=1</code> to be specified to enable the <code class=\"notranslate\">inline</code> cache exporter.<br>\nHowever, the standalone <code class=\"notranslate\">buildctl</code> does NOT require <code class=\"notranslate\">--opt build-arg:BUILDKIT_INLINE_CACHE=1</code> and the build-arg is simply ignored.</p>\n<h4 dir=\"auto\">Registry (push image and cache separately)</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... \\\n  --output type=image,name=localhost:5000/myrepo:image,push=true \\\n  --export-cache type=registry,ref=localhost:5000/myrepo:buildcache \\\n  --import-cache type=registry,ref=localhost:5000/myrepo:buildcache\"><pre class=\"notranslate\">buildctl build ... \\\n  --output type=image,name=localhost:5000/myrepo:image,push=true \\\n  --export-cache type=registry,ref=localhost:5000/myrepo:buildcache \\\n  --import-cache type=registry,ref=localhost:5000/myrepo:buildcache</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">--export-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=registry</code></li>\n<li><code class=\"notranslate\">mode=&lt;min|max&gt;</code>: specify cache layers to export (default: <code class=\"notranslate\">min</code>)\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">min</code>: only export layers for the resulting image</li>\n<li><code class=\"notranslate\">max</code>: export all the layers of all intermediate steps</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">ref=&lt;ref&gt;</code>: specify repository reference to store cache, e.g. <code class=\"notranslate\">docker.io/user/image:tag</code></li>\n<li><code class=\"notranslate\">image-manifest=&lt;true|false&gt;</code>: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: <code class=\"notranslate\">true</code> since BuildKit <code class=\"notranslate\">v0.21</code>, must be used with <code class=\"notranslate\">oci-mediatypes=true</code>)</li>\n<li><code class=\"notranslate\">oci-mediatypes=&lt;true|false&gt;</code>: whether to use OCI mediatypes in exported manifests (default: <code class=\"notranslate\">true</code>, since BuildKit <code class=\"notranslate\">v0.8</code>)</li>\n<li><code class=\"notranslate\">compression=&lt;uncompressed|gzip|estargz|zstd&gt;</code>: choose compression type for layers newly created and cached, gzip is default value. estargz and zstd should be used with <code class=\"notranslate\">oci-mediatypes=true</code></li>\n<li><code class=\"notranslate\">compression-level=&lt;value&gt;</code>: choose compression level for gzip, estargz (0-9) and zstd (0-22)</li>\n<li><code class=\"notranslate\">force-compression=true</code>: forcibly apply <code class=\"notranslate\">compression</code> option to all layers</li>\n<li><code class=\"notranslate\">ignore-error=&lt;false|true&gt;</code>: specify if error is ignored in case cache export fails (default: <code class=\"notranslate\">false</code>)</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--import-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=registry</code></li>\n<li><code class=\"notranslate\">ref=&lt;ref&gt;</code>: specify repository reference to retrieve cache from, e.g. <code class=\"notranslate\">docker.io/user/image:tag</code></li>\n</ul>\n<h4 dir=\"auto\">Local directory</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --export-cache type=local,dest=path/to/output-dir\nbuildctl build ... --import-cache type=local,src=path/to/input-dir\"><pre class=\"notranslate\">buildctl build ... --export-cache type=local,dest=path/to/output-dir\nbuildctl build ... --import-cache type=local,src=path/to/input-dir</pre></div>\n<p dir=\"auto\">The directory layout conforms to OCI Image Spec v1.0.</p>\n<p dir=\"auto\"><code class=\"notranslate\">--export-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=local</code></li>\n<li><code class=\"notranslate\">mode=&lt;min|max&gt;</code>: specify cache layers to export (default: <code class=\"notranslate\">min</code>)\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">min</code>: only export layers for the resulting image</li>\n<li><code class=\"notranslate\">max</code>: export all the layers of all intermediate steps</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">dest=&lt;path&gt;</code>: destination directory for cache exporter</li>\n<li><code class=\"notranslate\">tag=&lt;tag&gt;</code>: specify custom tag of image to write to local index (default: <code class=\"notranslate\">latest</code>)</li>\n<li><code class=\"notranslate\">image-manifest=&lt;true|false&gt;</code>: whether to export cache manifest as an OCI-compatible image manifest rather than a manifest list/index (default: <code class=\"notranslate\">true</code> since BuildKit <code class=\"notranslate\">v0.21</code>, must be used with <code class=\"notranslate\">oci-mediatypes=true</code>)</li>\n<li><code class=\"notranslate\">oci-mediatypes=&lt;true|false&gt;</code>: whether to use OCI mediatypes in exported manifests (default <code class=\"notranslate\">true</code>, since BuildKit <code class=\"notranslate\">v0.8</code>)</li>\n<li><code class=\"notranslate\">compression=&lt;uncompressed|gzip|estargz|zstd&gt;</code>: choose compression type for layers newly created and cached, gzip is default value. estargz and zstd should be used with <code class=\"notranslate\">oci-mediatypes=true</code>.</li>\n<li><code class=\"notranslate\">compression-level=&lt;value&gt;</code>: compression level for gzip, estargz (0-9) and zstd (0-22)</li>\n<li><code class=\"notranslate\">force-compression=true</code>: forcibly apply <code class=\"notranslate\">compression</code> option to all layers</li>\n<li><code class=\"notranslate\">ignore-error=&lt;false|true&gt;</code>: specify if error is ignored in case cache export fails (default: <code class=\"notranslate\">false</code>)</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--import-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=local</code></li>\n<li><code class=\"notranslate\">src=&lt;path&gt;</code>: source directory for cache importer</li>\n<li><code class=\"notranslate\">tag=&lt;tag&gt;</code>: specify custom tag of image to read from local index (default: <code class=\"notranslate\">latest</code>)</li>\n<li><code class=\"notranslate\">digest=sha256:&lt;sha256digest&gt;</code>: specify explicit digest of the manifest list to import</li>\n</ul>\n<h4 dir=\"auto\">GitHub Actions cache (experimental)</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=gha \\\n  --import-cache type=gha\"><pre class=\"notranslate\">buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=gha \\\n  --import-cache type=gha</pre></div>\n<p dir=\"auto\">GitHub Actions cache saves both cache metadata and layers to GitHub's Cache service. This cache currently has a <a href=\"https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy\">size limit of 10GB</a> that is shared across different caches in the repo. If you exceed this limit, GitHub will save your cache but will begin evicting caches until the total size is less than 10 GB. Recycling caches too often can result in slower runtimes overall.</p>\n<p dir=\"auto\">Similarly to using <a href=\"https://github.com/actions/cache\">actions/cache</a>, caches are <a href=\"https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache\">scoped by branch</a>, with the default and target branches being available to every branch.</p>\n<p dir=\"auto\">Following attributes are required to authenticate against the <a href=\"https://github.com/tonistiigi/go-actions-cache/blob/master/api.md#authentication\">GitHub Actions Cache service API</a>:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">url</code>: Cache server URL (default <code class=\"notranslate\">$ACTIONS_CACHE_URL</code> or fallback to <code class=\"notranslate\">$ACTIONS_RESULTS_URL</code>)</li>\n<li><code class=\"notranslate\">url_v2</code>: Cache v2 server URL if <code class=\"notranslate\">$ACTIONS_CACHE_SERVICE_V2</code> set on the runner (default <code class=\"notranslate\">$ACTIONS_RESULTS_URL</code>)</li>\n<li><code class=\"notranslate\">token</code>: Access token (default <code class=\"notranslate\">$ACTIONS_RUNTIME_TOKEN</code>)</li>\n</ul>\n<p dir=\"auto\">ℹ️ This type of cache can be used with <a href=\"https://github.com/docker/build-push-action\">Docker Build Push Action</a><br>\nwhere <code class=\"notranslate\">url</code> and <code class=\"notranslate\">token</code> will be automatically set. To use this backend in an inline <code class=\"notranslate\">run</code> step, you have to include <a href=\"https://github.com/crazy-max/ghaction-github-runtime\">crazy-max/ghaction-github-runtime</a><br>\nin your workflow to expose the runtime.</p>\n<p dir=\"auto\"><code class=\"notranslate\">--export-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=gha</code></li>\n<li><code class=\"notranslate\">mode=&lt;min|max&gt;</code>: specify cache layers to export (default: <code class=\"notranslate\">min</code>)\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">min</code>: only export layers for the resulting image</li>\n<li><code class=\"notranslate\">max</code>: export all the layers of all intermediate steps</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">scope=&lt;scope&gt;</code>: which scope cache object belongs to (default <code class=\"notranslate\">buildkit</code>)</li>\n<li><code class=\"notranslate\">ignore-error=&lt;false|true&gt;</code>: specify if error is ignored in case cache export fails (default: <code class=\"notranslate\">false</code>)</li>\n<li><code class=\"notranslate\">timeout=&lt;duration&gt;</code>: sets the timeout duration for cache export (default: <code class=\"notranslate\">10m</code>)</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--import-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=gha</code></li>\n<li><code class=\"notranslate\">scope=&lt;scope&gt;</code>: which scope cache object belongs to (default <code class=\"notranslate\">buildkit</code>)</li>\n<li><code class=\"notranslate\">timeout=&lt;duration&gt;</code>: sets the timeout duration for cache import (default: <code class=\"notranslate\">10m</code>)</li>\n</ul>\n<h4 dir=\"auto\">S3 cache (experimental)</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=s3,region=eu-west-1,bucket=my_bucket,name=my_image \\\n  --import-cache type=s3,region=eu-west-1,bucket=my_bucket,name=my_image\"><pre class=\"notranslate\">buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=s3,region=eu-west-1,bucket=my_bucket,name=my_image \\\n  --import-cache type=s3,region=eu-west-1,bucket=my_bucket,name=my_image</pre></div>\n<p dir=\"auto\">The following attributes are required:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">bucket</code>: AWS S3 bucket (default: <code class=\"notranslate\">$AWS_BUCKET</code>)</li>\n<li><code class=\"notranslate\">region</code>: AWS region (default: <code class=\"notranslate\">$AWS_REGION</code>)</li>\n</ul>\n<p dir=\"auto\">Storage locations:</p>\n<ul dir=\"auto\">\n<li>blobs: <code class=\"notranslate\">s3://&lt;bucket&gt;/&lt;prefix&gt;&lt;blobs_prefix&gt;/&lt;sha256&gt;</code>, default: <code class=\"notranslate\">s3://&lt;bucket&gt;/blobs/&lt;sha256&gt;</code></li>\n<li>manifests: <code class=\"notranslate\">s3://&lt;bucket&gt;/&lt;prefix&gt;&lt;manifests_prefix&gt;/&lt;name&gt;</code>, default: <code class=\"notranslate\">s3://&lt;bucket&gt;/manifests/&lt;name&gt;</code></li>\n</ul>\n<p dir=\"auto\">S3 configuration:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">blobs_prefix</code>: global prefix to store / read blobs on s3 (default: <code class=\"notranslate\">blobs/</code>)</li>\n<li><code class=\"notranslate\">manifests_prefix</code>: global prefix to store / read manifests on s3 (default: <code class=\"notranslate\">manifests/</code>)</li>\n<li><code class=\"notranslate\">endpoint_url</code>: specify a specific S3 endpoint (default: empty)</li>\n<li><code class=\"notranslate\">use_path_style</code>: if set to <code class=\"notranslate\">true</code>, put the bucket name in the URL instead of in the hostname (default: <code class=\"notranslate\">false</code>)</li>\n</ul>\n<p dir=\"auto\">AWS Authentication:</p>\n<p dir=\"auto\">BuildKit relies on the [AWS Go SDK](<a href=\"https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html%5D(https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config#EnvConfig)\" rel=\"nofollow\">https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/config#EnvConfig)</a>. This means that all standard authentication methods through environment variables or config files are supported. This is especially true for AWS EC2 IAM Profile and AWS Web Identity Token (IAM roles in Kubernetes).</p>\n<p dir=\"auto\">Beware, these configurations must be available at buildkit daemon level, not at client level.</p>\n<ul dir=\"auto\">\n<li>The following attributes can be used to forward static credentials from a buildkit client to the daemon (buildx for example).\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">access_key_id</code>: Access Key ID</li>\n<li><code class=\"notranslate\">secret_access_key</code>: Secret Access Key</li>\n<li><code class=\"notranslate\">session_token</code>: Session Token</li>\n</ul>\n</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--export-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=s3</code></li>\n<li><code class=\"notranslate\">mode=&lt;min|max&gt;</code>: specify cache layers to export (default: <code class=\"notranslate\">min</code>)\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">min</code>: only export layers for the resulting image</li>\n<li><code class=\"notranslate\">max</code>: export all the layers of all intermediate steps</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">prefix=&lt;prefix&gt;</code>: set global prefix to store / read files on s3 (default: empty)</li>\n<li><code class=\"notranslate\">name=&lt;manifest&gt;</code>: specify name of the manifest to use (default <code class=\"notranslate\">buildkit</code>)\n<ul dir=\"auto\">\n<li>Multiple manifest names can be specified at the same time, separated by <code class=\"notranslate\">;</code>. The standard use case is to use the git sha1 as name, and the branch name as duplicate, and load both with 2 <code class=\"notranslate\">import-cache</code> commands.</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">ignore-error=&lt;false|true&gt;</code>: specify if error is ignored in case cache export fails (default: <code class=\"notranslate\">false</code>)</li>\n<li><code class=\"notranslate\">touch_refresh=24h</code>: Instead of being uploaded again when not changed, blobs files will be \"touched\" on s3 every <code class=\"notranslate\">touch_refresh</code>, default is 24h. Due to this, an expiration policy can be set on the S3 bucket to cleanup useless files automatically. Manifests files are systematically rewritten, there is no need to touch them.</li>\n<li><code class=\"notranslate\">upload_parallelism=4</code>: This parameter changes the number of layers uploaded to s3 in parallel. Each individual layer is uploaded with 5 threads, using the Upload manager provided by the AWS SDK.</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--import-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=s3</code></li>\n<li><code class=\"notranslate\">prefix=&lt;prefix&gt;</code>: set global prefix to store / read files on s3 (default: empty)</li>\n<li><code class=\"notranslate\">blobs_prefix=&lt;prefix&gt;</code>: set global prefix to store / read blobs on s3 (default: <code class=\"notranslate\">blobs/</code>)</li>\n<li><code class=\"notranslate\">manifests_prefix=&lt;prefix&gt;</code>: set global prefix to store / read manifests on s3 (default: <code class=\"notranslate\">manifests/</code>)</li>\n<li><code class=\"notranslate\">name=&lt;manifest&gt;</code>: name of the manifest to use (default <code class=\"notranslate\">buildkit</code>)</li>\n</ul>\n<h4 dir=\"auto\">Azure Blob Storage cache (experimental)</h4>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image \\\n  --import-cache type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image\"><pre class=\"notranslate\">buildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image \\\n  --import-cache type=azblob,account_url=https://myaccount.blob.core.windows.net,name=my_image</pre></div>\n<p dir=\"auto\">The following attributes are required:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">account_url</code>: The Azure Blob Storage account URL (default: <code class=\"notranslate\">$BUILDKIT_AZURE_STORAGE_ACCOUNT_URL</code>)</li>\n</ul>\n<p dir=\"auto\">Storage locations:</p>\n<ul dir=\"auto\">\n<li>blobs: <code class=\"notranslate\">&lt;account_url&gt;/&lt;container&gt;/&lt;prefix&gt;&lt;blobs_prefix&gt;/&lt;sha256&gt;</code>, default: <code class=\"notranslate\">&lt;account_url&gt;/&lt;container&gt;/blobs/&lt;sha256&gt;</code></li>\n<li>manifests: <code class=\"notranslate\">&lt;account_url&gt;/&lt;container&gt;/&lt;prefix&gt;&lt;manifests_prefix&gt;/&lt;name&gt;</code>, default: <code class=\"notranslate\">&lt;account_url&gt;/&lt;container&gt;/manifests/&lt;name&gt;</code></li>\n</ul>\n<p dir=\"auto\">Azure Blob Storage configuration:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">container</code>: The Azure Blob Storage container name (default: <code class=\"notranslate\">buildkit-cache</code> or <code class=\"notranslate\">$BUILDKIT_AZURE_STORAGE_CONTAINER</code> if set)</li>\n<li><code class=\"notranslate\">blobs_prefix</code>: Global prefix to store / read blobs on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: <code class=\"notranslate\">blobs/</code>)</li>\n<li><code class=\"notranslate\">manifests_prefix</code>: Global prefix to store / read blobs on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: <code class=\"notranslate\">manifests/</code>)</li>\n</ul>\n<p dir=\"auto\">Azure Blob Storage authentication:</p>\n<p dir=\"auto\">There are 2 options supported for Azure Blob Storage authentication:</p>\n<ul dir=\"auto\">\n<li>Any system using environment variables supported by the <a href=\"https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication\" rel=\"nofollow\">Azure SDK for Go</a>. The configuration must be available for the buildkit daemon, not for the client.</li>\n<li>Secret Access Key, using the <code class=\"notranslate\">secret_access_key</code> attribute to specify the primary or secondary account key for your Azure Blob Storage account. <a href=\"https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage\" rel=\"nofollow\">Azure Blob Storage account keys</a></li>\n</ul>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">Account name can also be specified with <code class=\"notranslate\">account_name</code> attribute (or <code class=\"notranslate\">$BUILDKIT_AZURE_STORAGE_ACCOUNT_NAME</code>)<br>\nif it is not part of the account URL host.</p>\n</div>\n<p dir=\"auto\"><code class=\"notranslate\">--export-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=azblob</code></li>\n<li><code class=\"notranslate\">mode=&lt;min|max&gt;</code>: specify cache layers to export (default: <code class=\"notranslate\">min</code>)\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">min</code>: only export layers for the resulting image</li>\n<li><code class=\"notranslate\">max</code>: export all the layers of all intermediate steps</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">prefix=&lt;prefix&gt;</code>: set global prefix to store / read files on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: empty)</li>\n<li><code class=\"notranslate\">name=&lt;manifest&gt;</code>: specify name of the manifest to use (default: <code class=\"notranslate\">buildkit</code>)\n<ul dir=\"auto\">\n<li>Multiple manifest names can be specified at the same time, separated by <code class=\"notranslate\">;</code>. The standard use case is to use the git sha1 as name, and the branch name as duplicate, and load both with 2 <code class=\"notranslate\">import-cache</code> commands.</li>\n</ul>\n</li>\n<li><code class=\"notranslate\">ignore-error=&lt;false|true&gt;</code>: specify if error is ignored in case cache export fails (default: <code class=\"notranslate\">false</code>)</li>\n</ul>\n<p dir=\"auto\"><code class=\"notranslate\">--import-cache</code> options:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">type=azblob</code></li>\n<li><code class=\"notranslate\">prefix=&lt;prefix&gt;</code>: set global prefix to store / read files on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: empty)</li>\n<li><code class=\"notranslate\">blobs_prefix=&lt;prefix&gt;</code>: set global prefix to store / read blobs on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: <code class=\"notranslate\">blobs/</code>)</li>\n<li><code class=\"notranslate\">manifests_prefix=&lt;prefix&gt;</code>: set global prefix to store / read manifests on the Azure Blob Storage container (<code class=\"notranslate\">&lt;container&gt;</code>) (default: <code class=\"notranslate\">manifests/</code>)</li>\n<li><code class=\"notranslate\">name=&lt;manifest&gt;</code>: name of the manifest to use (default: <code class=\"notranslate\">buildkit</code>)</li>\n</ul>\n<h3 dir=\"auto\">Consistent hashing</h3>\n<p dir=\"auto\">If you have multiple BuildKit daemon instances, but you don't want to use registry for sharing cache across the cluster,<br>\nconsider client-side load balancing using consistent hashing.</p>\n<p dir=\"auto\">See <a href=\"./examples/kubernetes/consistenthash\"><code class=\"notranslate\">./examples/kubernetes/consistenthash</code></a>.</p>\n<h2 dir=\"auto\">Metadata</h2>\n<p dir=\"auto\">To output build metadata such as the image digest, pass the <code class=\"notranslate\">--metadata-file</code> flag.<br>\nThe metadata will be written as a JSON object to the specified file.<br>\nThe directory of the specified file must already exist and be writable.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl build ... --metadata-file metadata.json\"><pre class=\"notranslate\">buildctl build ... --metadata-file metadata.json</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"jq '.' metadata.json\"><pre class=\"notranslate\">jq <span class=\"pl-s\"><span class=\"pl-pds\">'</span>.<span class=\"pl-pds\">'</span></span> metadata.json</pre></div>\n<div class=\"highlight highlight-source-json notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"{\n  &quot;containerimage.config.digest&quot;: &quot;sha256:2937f66a9722f7f4a2df583de2f8cb97fc9196059a410e7f00072fc918930e66&quot;,\n  &quot;containerimage.descriptor&quot;: {\n    &quot;annotations&quot;: {\n      &quot;config.digest&quot;: &quot;sha256:2937f66a9722f7f4a2df583de2f8cb97fc9196059a410e7f00072fc918930e66&quot;,\n      &quot;org.opencontainers.image.created&quot;: &quot;2022-02-08T21:28:03Z&quot;\n    },\n    &quot;digest&quot;: &quot;sha256:19ffeab6f8bc9293ac2c3fdf94ebe28396254c993aea0b5a542cfb02e0883fa3&quot;,\n    &quot;mediaType&quot;: &quot;application/vnd.oci.image.manifest.v1+json&quot;,\n    &quot;size&quot;: 506\n  },\n  &quot;containerimage.digest&quot;: &quot;sha256:19ffeab6f8bc9293ac2c3fdf94ebe28396254c993aea0b5a542cfb02e0883fa3&quot;\n}\"><pre class=\"notranslate\">{\n  <span class=\"pl-ent\">\"containerimage.config.digest\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>sha256:2937f66a9722f7f4a2df583de2f8cb97fc9196059a410e7f00072fc918930e66<span class=\"pl-pds\">\"</span></span>,\n  <span class=\"pl-ent\">\"containerimage.descriptor\"</span>: {\n    <span class=\"pl-ent\">\"annotations\"</span>: {\n      <span class=\"pl-ent\">\"config.digest\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>sha256:2937f66a9722f7f4a2df583de2f8cb97fc9196059a410e7f00072fc918930e66<span class=\"pl-pds\">\"</span></span>,\n      <span class=\"pl-ent\">\"org.opencontainers.image.created\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>2022-02-08T21:28:03Z<span class=\"pl-pds\">\"</span></span>\n    },\n    <span class=\"pl-ent\">\"digest\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>sha256:19ffeab6f8bc9293ac2c3fdf94ebe28396254c993aea0b5a542cfb02e0883fa3<span class=\"pl-pds\">\"</span></span>,\n    <span class=\"pl-ent\">\"mediaType\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>application/vnd.oci.image.manifest.v1+json<span class=\"pl-pds\">\"</span></span>,\n    <span class=\"pl-ent\">\"size\"</span>: <span class=\"pl-c1\">506</span>\n  },\n  <span class=\"pl-ent\">\"containerimage.digest\"</span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"</span>sha256:19ffeab6f8bc9293ac2c3fdf94ebe28396254c993aea0b5a542cfb02e0883fa3<span class=\"pl-pds\">\"</span></span>\n}</pre></div>\n<h2 dir=\"auto\">Systemd socket activation</h2>\n<p dir=\"auto\">On Systemd based systems, you can communicate with the daemon via <a href=\"http://0pointer.de/blog/projects/socket-activation.html\" rel=\"nofollow\">Systemd socket activation</a>, use <code class=\"notranslate\">buildkitd --addr fd://</code>.<br>\nYou can find examples of using Systemd socket activation with BuildKit and Systemd in <a href=\"./examples/systemd\"><code class=\"notranslate\">./examples/systemd</code></a>.</p>\n<h2 dir=\"auto\">Expose BuildKit as a TCP service</h2>\n<p dir=\"auto\">The <code class=\"notranslate\">buildkitd</code> daemon can listen the gRPC API on a TCP socket.</p>\n<p dir=\"auto\">It is highly recommended to create TLS certificates for both the daemon and the client (mTLS).<br>\nEnabling TCP without mTLS is dangerous because the executor containers (aka Dockerfile <code class=\"notranslate\">RUN</code> containers) can call BuildKit API as well.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildkitd \\\n  --addr tcp://0.0.0.0:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/cert.pem \\\n  --tlskey /path/to/key.pem\"><pre class=\"notranslate\">buildkitd \\\n  --addr tcp://0.0.0.0:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/cert.pem \\\n  --tlskey /path/to/key.pem</pre></div>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"buildctl \\\n  --addr tcp://example.com:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/clientcert.pem \\\n  --tlskey /path/to/clientkey.pem \\\n  build ...\"><pre class=\"notranslate\">buildctl \\\n  --addr tcp://example.com:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/clientcert.pem \\\n  --tlskey /path/to/clientkey.pem \\\n  build ...</pre></div>\n<h3 dir=\"auto\">Load balancing</h3>\n<p dir=\"auto\"><code class=\"notranslate\">buildctl build</code> can be called against randomly load balanced <code class=\"notranslate\">buildkitd</code> daemons.</p>\n<p dir=\"auto\">See also <a href=\"#consistent-hashing\">Consistent hashing</a> for client-side load balancing.</p>\n<h2 dir=\"auto\">Containerizing BuildKit</h2>\n<p dir=\"auto\">BuildKit can also be used by running the <code class=\"notranslate\">buildkitd</code> daemon inside a Docker container and accessing it remotely.</p>\n<p dir=\"auto\">We provide the container images as <a href=\"https://hub.docker.com/r/moby/buildkit/tags/\" rel=\"nofollow\"><code class=\"notranslate\">moby/buildkit</code></a>:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">moby/buildkit:latest</code>: built from the latest regular <a href=\"https://github.com/moby/buildkit/releases\">release</a></li>\n<li><code class=\"notranslate\">moby/buildkit:rootless</code>: same as <code class=\"notranslate\">latest</code> but runs as an unprivileged user, see <a href=\"docs/rootless.md\"><code class=\"notranslate\">docs/rootless.md</code></a></li>\n<li><code class=\"notranslate\">moby/buildkit:master</code>: built from the master branch</li>\n<li><code class=\"notranslate\">moby/buildkit:master-rootless</code>: same as master but runs as an unprivileged user, see <a href=\"docs/rootless.md\"><code class=\"notranslate\">docs/rootless.md</code></a></li>\n</ul>\n<p dir=\"auto\">To run daemon in a container:</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d --name buildkitd --privileged moby/buildkit:latest\nexport BUILDKIT_HOST=docker-container://buildkitd\nbuildctl build --help\"><pre class=\"notranslate\">docker run -d --name buildkitd --privileged moby/buildkit:latest\n<span class=\"pl-k\">export</span> BUILDKIT_HOST=docker-container://buildkitd\nbuildctl build --help</pre></div>\n<h3 dir=\"auto\">Podman</h3>\n<p dir=\"auto\">To connect to a BuildKit daemon running in a Podman container, use <code class=\"notranslate\">podman-container://</code> instead of <code class=\"notranslate\">docker-container://</code> .</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"podman run -d --name buildkitd --privileged moby/buildkit:latest\nbuildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=oci | podman load foo\"><pre class=\"notranslate\">podman run -d --name buildkitd --privileged moby/buildkit:latest\nbuildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=oci <span class=\"pl-k\">|</span> podman load foo</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">sudo</code> is not required.</p>\n<h3 dir=\"auto\">Nerdctl</h3>\n<p dir=\"auto\">To connect to a BuildKit daemon running in a Nerdctl container, use <code class=\"notranslate\">nerdctl-container://</code> instead of <code class=\"notranslate\">docker-container://</code>.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"nerdctl run -d --name buildkitd --privileged moby/buildkit:latest\nbuildctl --addr=nerdctl-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=oci | nerdctl load\"><pre class=\"notranslate\">nerdctl run -d --name buildkitd --privileged moby/buildkit:latest\nbuildctl --addr=nerdctl-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=oci <span class=\"pl-k\">|</span> nerdctl load</pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">sudo</code> is not required.</p>\n<h3 dir=\"auto\">Kubernetes</h3>\n<p dir=\"auto\">For Kubernetes deployments, see <a href=\"./examples/kubernetes\"><code class=\"notranslate\">examples/kubernetes</code></a>.</p>\n<h3 dir=\"auto\">Daemonless</h3>\n<p dir=\"auto\">To run the client and an ephemeral daemon in a single container (\"daemonless mode\"):</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run \\\n    -it \\\n    --rm \\\n    --privileged \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master \\\n        build \\\n        --frontend dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work\"><pre class=\"notranslate\">docker run \\\n    -it \\\n    --rm \\\n    --privileged \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master \\\n        build \\\n        --frontend dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work</pre></div>\n<p dir=\"auto\">or</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run \\\n    -it \\\n    --rm \\\n    --security-opt seccomp=unconfined \\\n    --security-opt apparmor=unconfined \\\n    -e BUILDKITD_FLAGS=--oci-worker-no-process-sandbox \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master-rootless \\\n        build \\\n        --frontend \\\n        dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work\"><pre class=\"notranslate\">docker run \\\n    -it \\\n    --rm \\\n    --security-opt seccomp=unconfined \\\n    --security-opt apparmor=unconfined \\\n    -e BUILDKITD_FLAGS=--oci-worker-no-process-sandbox \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master-rootless \\\n        build \\\n        --frontend \\\n        dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work</pre></div>\n<h2 dir=\"auto\">OpenTelemetry support</h2>\n<p dir=\"auto\">BuildKit supports <a href=\"https://opentelemetry.io/\" rel=\"nofollow\">OpenTelemetry</a> for buildkitd gRPC<br>\nAPI and buildctl commands. To capture the trace to<br>\n<a href=\"https://github.com/jaegertracing/jaeger\">Jaeger</a>, set <code class=\"notranslate\">JAEGER_TRACE</code><br>\nenvironment variable to the collection address.</p>\n<div class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"docker run -d -p6831:6831/udp -p16686:16686 jaegertracing/all-in-one:latest\nexport JAEGER_TRACE=0.0.0.0:6831\n# restart buildkitd and buildctl so they know JAEGER_TRACE\n# any buildctl command should be traced to http://127.0.0.1:16686/\"><pre class=\"notranslate\">docker run -d -p6831:6831/udp -p16686:16686 jaegertracing/all-in-one:latest\n<span class=\"pl-k\">export</span> JAEGER_TRACE=0.0.0.0:6831\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> restart buildkitd and buildctl so they know JAEGER_TRACE</span>\n<span class=\"pl-c\"><span class=\"pl-c\">#</span> any buildctl command should be traced to http://127.0.0.1:16686/</span></pre></div>\n<blockquote>\n<p dir=\"auto\">On Windows, if you are running Jaeger outside of a container, <a href=\"https://www.jaegertracing.io/docs/1.57/getting-started/#all-in-one\" rel=\"nofollow\"><code class=\"notranslate\">jaeger-all-in-one.exe</code></a>,<br>\nset the environment variable <code class=\"notranslate\">setx -m JAEGER_TRACE \"0.0.0.0:6831\"</code>,<br>\nrestart <code class=\"notranslate\">buildkitd</code> in a new terminal and the traces will be collected automatically.</p>\n</blockquote>\n<h2 dir=\"auto\">Running BuildKit without root privileges</h2>\n<p dir=\"auto\">Please refer to <a href=\"docs/rootless.md\"><code class=\"notranslate\">docs/rootless.md</code></a>.</p>\n<h2 dir=\"auto\">Building multi-platform images</h2>\n<p dir=\"auto\">Please refer to <a href=\"docs/multi-platform.md\"><code class=\"notranslate\">docs/multi-platform.md</code></a>.</p>\n<h3 dir=\"auto\">Configuring <code class=\"notranslate\">buildctl</code></h3>\n<h4 dir=\"auto\">Color Output Controls</h4>\n<p dir=\"auto\"><code class=\"notranslate\">buildctl</code> has support for modifying the colors that are used to output information to the terminal. You can set the environment variable <code class=\"notranslate\">BUILDKIT_COLORS</code> to something like <code class=\"notranslate\">run=green:warning=yellow:error=red:cancel=255,165,0</code> to set the colors that you would like to use. Setting <code class=\"notranslate\">NO_COLOR</code> to anything will disable any colorized output as recommended by <a href=\"https://no-color.org/\" rel=\"nofollow\">no-color.org</a>.</p>\n<p dir=\"auto\">Parsing errors will be reported but ignored. This will result in default color values being used where needed.</p>\n<ul dir=\"auto\">\n<li><a href=\"https://github.com/moby/buildkit/blob/master/util/progress/progressui/colors.go\">The list of pre-defined colors</a>.</li>\n</ul>\n<h4 dir=\"auto\">Number of log lines (for active steps in tty mode)</h4>\n<p dir=\"auto\">You can change how many log lines are visible for active steps in tty mode by setting <code class=\"notranslate\">BUILDKIT_TTY_LOG_LINES</code> to a number (default: 6).</p>\n<h2 dir=\"auto\">Contributing</h2>\n<p dir=\"auto\">Want to contribute to BuildKit? Awesome! You can find information about contributing to this project in the <a href=\"/.github/CONTRIBUTING.md\">CONTRIBUTING.md</a></p>","updatedAt":"2025-05-21T15:50:44Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"Docker-Tools","color":"abbcfb"}},{"node":{"name":"moby","color":"0791ef"}}]},"comments":{"edges":[]}}},"pageContext":{"number":58,"previous":{"title":"aristocratos/btop: 系统资源监视器显示处理器、内存、磁盘、网络和进程的使用情况和统计​​信息","number":57},"next":{"title":"TeaWeb/build: TeaWeb 是一款集静态资源、缓存、代理、统计、日志、安全、监控于一体的可视化智能 WebServer。","number":59}}},
    "staticQueryHashes": ["151096407","2861350382"]}