@lakutata/containerd 0.0.0-stage → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +409 -2
  3. package/THIRD_PARTY_NOTICES.md +310 -0
  4. package/dist/cjs/client/BuildKit.d.ts +176 -0
  5. package/dist/cjs/client/BuildKit.js +536 -0
  6. package/dist/cjs/client/BuildKitMessages.d.ts +35 -0
  7. package/dist/cjs/client/BuildKitMessages.js +123 -0
  8. package/dist/cjs/client/ContainerStore.d.ts +558 -0
  9. package/dist/cjs/client/ContainerStore.js +1384 -0
  10. package/dist/cjs/client/ContainerdClient.d.ts +244 -0
  11. package/dist/cjs/client/ContainerdClient.js +455 -0
  12. package/dist/cjs/client/DockerIgnore.d.ts +44 -0
  13. package/dist/cjs/client/DockerIgnore.js +186 -0
  14. package/dist/cjs/client/Fifo.d.ts +31 -0
  15. package/dist/cjs/client/Fifo.js +66 -0
  16. package/dist/cjs/client/ImageStore.d.ts +258 -0
  17. package/dist/cjs/client/ImageStore.js +636 -0
  18. package/dist/cjs/client/Messages.d.ts +103 -0
  19. package/dist/cjs/client/Messages.js +397 -0
  20. package/dist/cjs/client/Networks.d.ts +221 -0
  21. package/dist/cjs/client/Networks.js +630 -0
  22. package/dist/cjs/client/Platforms.d.ts +53 -0
  23. package/dist/cjs/client/Platforms.js +169 -0
  24. package/dist/cjs/client/Reference.d.ts +33 -0
  25. package/dist/cjs/client/Reference.js +70 -0
  26. package/dist/cjs/client/Registry.d.ts +145 -0
  27. package/dist/cjs/client/Registry.js +272 -0
  28. package/dist/cjs/client/Rootfs.d.ts +83 -0
  29. package/dist/cjs/client/Rootfs.js +245 -0
  30. package/dist/cjs/client/Seccomp.d.ts +36 -0
  31. package/dist/cjs/client/Seccomp.js +156 -0
  32. package/dist/cjs/client/Spec.d.ts +151 -0
  33. package/dist/cjs/client/Spec.js +227 -0
  34. package/dist/cjs/client/Volumes.d.ts +42 -0
  35. package/dist/cjs/client/Volumes.js +80 -0
  36. package/dist/cjs/containerd/Containerd.d.ts +442 -0
  37. package/dist/cjs/containerd/Containerd.js +929 -0
  38. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  39. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.js +16 -0
  40. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  41. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.js +15 -0
  42. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  43. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.js +16 -0
  44. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  45. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.js +17 -0
  46. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  47. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.js +16 -0
  48. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  49. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.js +16 -0
  50. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  51. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.js +16 -0
  52. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  53. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.js +16 -0
  54. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  55. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.js +16 -0
  56. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  57. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.js +15 -0
  58. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  59. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.js +16 -0
  60. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  61. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.js +16 -0
  62. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  63. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.js +15 -0
  64. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  65. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.js +16 -0
  66. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  67. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.js +15 -0
  68. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  69. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.js +15 -0
  70. package/dist/cjs/containerd/lib/ContainerdContainer.d.ts +292 -0
  71. package/dist/cjs/containerd/lib/ContainerdContainer.js +536 -0
  72. package/dist/cjs/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  73. package/dist/cjs/containerd/lib/ContainerdContainerTTY.js +178 -0
  74. package/dist/cjs/containerd/lib/ContainerdErrors.d.ts +6 -0
  75. package/dist/cjs/containerd/lib/ContainerdErrors.js +37 -0
  76. package/dist/cjs/containerd/lib/ContainerdImage.d.ts +149 -0
  77. package/dist/cjs/containerd/lib/ContainerdImage.js +222 -0
  78. package/dist/cjs/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  79. package/dist/cjs/containerd/options/ContainerdPruneOptions.js +51 -0
  80. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  81. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.js +45 -0
  82. package/dist/cjs/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  83. package/dist/cjs/containerd/options/container/ContainerCommitOptions.js +66 -0
  84. package/dist/cjs/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  85. package/dist/cjs/containerd/options/container/ContainerCreateOptions.js +239 -0
  86. package/dist/cjs/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  87. package/dist/cjs/containerd/options/container/ContainerExecOptions.js +63 -0
  88. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  89. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.js +45 -0
  90. package/dist/cjs/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  91. package/dist/cjs/containerd/options/container/ContainerKillOptions.js +41 -0
  92. package/dist/cjs/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  93. package/dist/cjs/containerd/options/container/ContainerLogsOptions.js +44 -0
  94. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  95. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.js +34 -0
  96. package/dist/cjs/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  97. package/dist/cjs/containerd/options/container/ContainerResourceOptions.js +67 -0
  98. package/dist/cjs/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  99. package/dist/cjs/containerd/options/container/ContainerStopOptions.js +41 -0
  100. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  101. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.js +40 -0
  102. package/dist/cjs/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  103. package/dist/cjs/containerd/options/container/ContainerTTYOptions.js +63 -0
  104. package/dist/cjs/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  105. package/dist/cjs/containerd/options/image/ImageBuildOptions.js +95 -0
  106. package/dist/cjs/containerd/options/image/ImageExportOptions.d.ts +25 -0
  107. package/dist/cjs/containerd/options/image/ImageExportOptions.js +39 -0
  108. package/dist/cjs/containerd/options/image/ImageImportOptions.d.ts +38 -0
  109. package/dist/cjs/containerd/options/image/ImageImportOptions.js +47 -0
  110. package/dist/cjs/containerd/options/image/ImagePullOptions.d.ts +53 -0
  111. package/dist/cjs/containerd/options/image/ImagePullOptions.js +66 -0
  112. package/dist/cjs/containerd/options/image/ImagePushOptions.d.ts +44 -0
  113. package/dist/cjs/containerd/options/image/ImagePushOptions.js +58 -0
  114. package/dist/cjs/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  115. package/dist/cjs/containerd/options/network/NetworkCreateOptions.js +83 -0
  116. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  117. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.js +40 -0
  118. package/dist/cjs/containerd/types/ContainerdBind.d.ts +28 -0
  119. package/dist/cjs/containerd/types/ContainerdBind.js +2 -0
  120. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  121. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.js +2 -0
  122. package/dist/cjs/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  123. package/dist/cjs/containerd/types/ContainerdContainerNetwork.js +2 -0
  124. package/dist/cjs/containerd/types/ContainerdContainerPort.d.ts +22 -0
  125. package/dist/cjs/containerd/types/ContainerdContainerPort.js +2 -0
  126. package/dist/cjs/containerd/types/ContainerdContainerState.d.ts +42 -0
  127. package/dist/cjs/containerd/types/ContainerdContainerState.js +2 -0
  128. package/dist/cjs/containerd/types/ContainerdContainerStats.d.ts +107 -0
  129. package/dist/cjs/containerd/types/ContainerdContainerStats.js +2 -0
  130. package/dist/cjs/containerd/types/ContainerdDevice.d.ts +25 -0
  131. package/dist/cjs/containerd/types/ContainerdDevice.js +2 -0
  132. package/dist/cjs/containerd/types/ContainerdExecResult.d.ts +18 -0
  133. package/dist/cjs/containerd/types/ContainerdExecResult.js +2 -0
  134. package/dist/cjs/containerd/types/ContainerdImageConfig.d.ts +46 -0
  135. package/dist/cjs/containerd/types/ContainerdImageConfig.js +2 -0
  136. package/dist/cjs/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  137. package/dist/cjs/containerd/types/ContainerdNetworkInfo.js +2 -0
  138. package/dist/cjs/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  139. package/dist/cjs/containerd/types/ContainerdProgressCallback.js +2 -0
  140. package/dist/cjs/containerd/types/ContainerdPruneResult.d.ts +21 -0
  141. package/dist/cjs/containerd/types/ContainerdPruneResult.js +2 -0
  142. package/dist/cjs/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  143. package/dist/cjs/containerd/types/ContainerdRestartPolicy.js +2 -0
  144. package/dist/cjs/containerd/types/ContainerdTmpfs.d.ts +20 -0
  145. package/dist/cjs/containerd/types/ContainerdTmpfs.js +2 -0
  146. package/dist/cjs/containerd/types/ContainerdVolume.d.ts +19 -0
  147. package/dist/cjs/containerd/types/ContainerdVolume.js +2 -0
  148. package/dist/cjs/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  149. package/dist/cjs/containerd/types/ContainerdVolumeInfo.js +2 -0
  150. package/dist/cjs/exports/Containerd.d.ts +69 -0
  151. package/dist/cjs/exports/Containerd.js +87 -0
  152. package/dist/cjs/package.json +1 -0
  153. package/dist/esm/client/BuildKit.js +488 -0
  154. package/dist/esm/client/BuildKitMessages.js +120 -0
  155. package/dist/esm/client/ContainerStore.js +1339 -0
  156. package/dist/esm/client/ContainerdClient.js +416 -0
  157. package/dist/esm/client/DockerIgnore.js +179 -0
  158. package/dist/esm/client/Fifo.js +59 -0
  159. package/dist/esm/client/ImageStore.js +628 -0
  160. package/dist/esm/client/Messages.js +393 -0
  161. package/dist/esm/client/Networks.js +621 -0
  162. package/dist/esm/client/Platforms.js +156 -0
  163. package/dist/esm/client/Reference.js +66 -0
  164. package/dist/esm/client/Registry.js +263 -0
  165. package/dist/esm/client/Rootfs.js +234 -0
  166. package/dist/esm/client/Seccomp.js +152 -0
  167. package/dist/esm/client/Spec.js +220 -0
  168. package/dist/esm/client/Volumes.js +73 -0
  169. package/dist/esm/containerd/Containerd.js +923 -0
  170. package/dist/esm/containerd/exceptions/ContainerdConnectionException.js +12 -0
  171. package/dist/esm/containerd/exceptions/ContainerdContainerNameConflictException.js +11 -0
  172. package/dist/esm/containerd/exceptions/ContainerdContainerNotFoundException.js +12 -0
  173. package/dist/esm/containerd/exceptions/ContainerdContainerStateException.js +13 -0
  174. package/dist/esm/containerd/exceptions/ContainerdImageBuildException.js +12 -0
  175. package/dist/esm/containerd/exceptions/ContainerdImageExportException.js +12 -0
  176. package/dist/esm/containerd/exceptions/ContainerdImageImportException.js +12 -0
  177. package/dist/esm/containerd/exceptions/ContainerdImageNotFoundException.js +12 -0
  178. package/dist/esm/containerd/exceptions/ContainerdImagePullException.js +12 -0
  179. package/dist/esm/containerd/exceptions/ContainerdImagePushException.js +11 -0
  180. package/dist/esm/containerd/exceptions/ContainerdNetworkConflictException.js +12 -0
  181. package/dist/esm/containerd/exceptions/ContainerdNetworkNotFoundException.js +12 -0
  182. package/dist/esm/containerd/exceptions/ContainerdPathNotFoundException.js +11 -0
  183. package/dist/esm/containerd/exceptions/ContainerdPlatformException.js +12 -0
  184. package/dist/esm/containerd/exceptions/ContainerdVolumeInUseException.js +11 -0
  185. package/dist/esm/containerd/exceptions/ContainerdVolumeNotFoundException.js +11 -0
  186. package/dist/esm/containerd/lib/ContainerdContainer.js +533 -0
  187. package/dist/esm/containerd/lib/ContainerdContainerTTY.js +175 -0
  188. package/dist/esm/containerd/lib/ContainerdErrors.js +34 -0
  189. package/dist/esm/containerd/lib/ContainerdImage.js +219 -0
  190. package/dist/esm/containerd/options/ContainerdPruneOptions.js +47 -0
  191. package/dist/esm/containerd/options/ContainerdRegistryAuthOptions.js +41 -0
  192. package/dist/esm/containerd/options/container/ContainerCommitOptions.js +62 -0
  193. package/dist/esm/containerd/options/container/ContainerCreateOptions.js +235 -0
  194. package/dist/esm/containerd/options/container/ContainerExecOptions.js +59 -0
  195. package/dist/esm/containerd/options/container/ContainerExportDirectoryOptions.js +41 -0
  196. package/dist/esm/containerd/options/container/ContainerKillOptions.js +37 -0
  197. package/dist/esm/containerd/options/container/ContainerLogsOptions.js +40 -0
  198. package/dist/esm/containerd/options/container/ContainerRemoveOptions.js +30 -0
  199. package/dist/esm/containerd/options/container/ContainerResourceOptions.js +63 -0
  200. package/dist/esm/containerd/options/container/ContainerStopOptions.js +37 -0
  201. package/dist/esm/containerd/options/container/ContainerTTYConsoleSizeOptions.js +36 -0
  202. package/dist/esm/containerd/options/container/ContainerTTYOptions.js +59 -0
  203. package/dist/esm/containerd/options/image/ImageBuildOptions.js +91 -0
  204. package/dist/esm/containerd/options/image/ImageExportOptions.js +35 -0
  205. package/dist/esm/containerd/options/image/ImageImportOptions.js +43 -0
  206. package/dist/esm/containerd/options/image/ImagePullOptions.js +62 -0
  207. package/dist/esm/containerd/options/image/ImagePushOptions.js +54 -0
  208. package/dist/esm/containerd/options/network/NetworkCreateOptions.js +79 -0
  209. package/dist/esm/containerd/options/volume/VolumeCreateOptions.js +36 -0
  210. package/dist/esm/containerd/types/ContainerdBind.js +1 -0
  211. package/dist/esm/containerd/types/ContainerdBuildOutputCallback.js +1 -0
  212. package/dist/esm/containerd/types/ContainerdContainerNetwork.js +1 -0
  213. package/dist/esm/containerd/types/ContainerdContainerPort.js +1 -0
  214. package/dist/esm/containerd/types/ContainerdContainerState.js +1 -0
  215. package/dist/esm/containerd/types/ContainerdContainerStats.js +1 -0
  216. package/dist/esm/containerd/types/ContainerdDevice.js +1 -0
  217. package/dist/esm/containerd/types/ContainerdExecResult.js +1 -0
  218. package/dist/esm/containerd/types/ContainerdImageConfig.js +1 -0
  219. package/dist/esm/containerd/types/ContainerdNetworkInfo.js +1 -0
  220. package/dist/esm/containerd/types/ContainerdProgressCallback.js +1 -0
  221. package/dist/esm/containerd/types/ContainerdPruneResult.js +1 -0
  222. package/dist/esm/containerd/types/ContainerdRestartPolicy.js +1 -0
  223. package/dist/esm/containerd/types/ContainerdTmpfs.js +1 -0
  224. package/dist/esm/containerd/types/ContainerdVolume.js +1 -0
  225. package/dist/esm/containerd/types/ContainerdVolumeInfo.js +1 -0
  226. package/dist/esm/exports/Containerd.js +68 -0
  227. package/dist/types/client/BuildKit.d.ts +176 -0
  228. package/dist/types/client/BuildKitMessages.d.ts +35 -0
  229. package/dist/types/client/ContainerStore.d.ts +558 -0
  230. package/dist/types/client/ContainerdClient.d.ts +244 -0
  231. package/dist/types/client/DockerIgnore.d.ts +44 -0
  232. package/dist/types/client/Fifo.d.ts +31 -0
  233. package/dist/types/client/ImageStore.d.ts +258 -0
  234. package/dist/types/client/Messages.d.ts +103 -0
  235. package/dist/types/client/Networks.d.ts +221 -0
  236. package/dist/types/client/Platforms.d.ts +53 -0
  237. package/dist/types/client/Reference.d.ts +33 -0
  238. package/dist/types/client/Registry.d.ts +145 -0
  239. package/dist/types/client/Rootfs.d.ts +83 -0
  240. package/dist/types/client/Seccomp.d.ts +36 -0
  241. package/dist/types/client/Spec.d.ts +151 -0
  242. package/dist/types/client/Volumes.d.ts +42 -0
  243. package/dist/types/containerd/Containerd.d.ts +442 -0
  244. package/dist/types/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  245. package/dist/types/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  246. package/dist/types/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  247. package/dist/types/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  248. package/dist/types/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  249. package/dist/types/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  250. package/dist/types/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  251. package/dist/types/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  252. package/dist/types/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  253. package/dist/types/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  254. package/dist/types/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  255. package/dist/types/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  256. package/dist/types/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  257. package/dist/types/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  258. package/dist/types/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  259. package/dist/types/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  260. package/dist/types/containerd/lib/ContainerdContainer.d.ts +292 -0
  261. package/dist/types/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  262. package/dist/types/containerd/lib/ContainerdErrors.d.ts +6 -0
  263. package/dist/types/containerd/lib/ContainerdImage.d.ts +149 -0
  264. package/dist/types/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  265. package/dist/types/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  266. package/dist/types/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  267. package/dist/types/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  268. package/dist/types/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  269. package/dist/types/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  270. package/dist/types/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  271. package/dist/types/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  272. package/dist/types/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  273. package/dist/types/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  274. package/dist/types/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  275. package/dist/types/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  276. package/dist/types/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  277. package/dist/types/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  278. package/dist/types/containerd/options/image/ImageExportOptions.d.ts +25 -0
  279. package/dist/types/containerd/options/image/ImageImportOptions.d.ts +38 -0
  280. package/dist/types/containerd/options/image/ImagePullOptions.d.ts +53 -0
  281. package/dist/types/containerd/options/image/ImagePushOptions.d.ts +44 -0
  282. package/dist/types/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  283. package/dist/types/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  284. package/dist/types/containerd/types/ContainerdBind.d.ts +28 -0
  285. package/dist/types/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  286. package/dist/types/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  287. package/dist/types/containerd/types/ContainerdContainerPort.d.ts +22 -0
  288. package/dist/types/containerd/types/ContainerdContainerState.d.ts +42 -0
  289. package/dist/types/containerd/types/ContainerdContainerStats.d.ts +107 -0
  290. package/dist/types/containerd/types/ContainerdDevice.d.ts +25 -0
  291. package/dist/types/containerd/types/ContainerdExecResult.d.ts +18 -0
  292. package/dist/types/containerd/types/ContainerdImageConfig.d.ts +46 -0
  293. package/dist/types/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  294. package/dist/types/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  295. package/dist/types/containerd/types/ContainerdPruneResult.d.ts +21 -0
  296. package/dist/types/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  297. package/dist/types/containerd/types/ContainerdTmpfs.d.ts +20 -0
  298. package/dist/types/containerd/types/ContainerdVolume.d.ts +19 -0
  299. package/dist/types/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  300. package/dist/types/exports/Containerd.d.ts +69 -0
  301. package/package.json +51 -4
@@ -0,0 +1,442 @@
1
+ import { Component } from '@lakutata/core';
2
+ import { type ContainerdEvent } from '../client/ContainerdClient.js';
3
+ import { type CNINetwork } from '../client/Networks.js';
4
+ import { type Message } from '@lakutata/grpc';
5
+ import type { RegistryCredentials, RegistryOptions } from '../client/Registry.js';
6
+ import { ContainerdImage } from './lib/ContainerdImage.js';
7
+ import { ContainerdContainer } from './lib/ContainerdContainer.js';
8
+ import { ContainerdPruneOptions } from './options/ContainerdPruneOptions.js';
9
+ import { VolumeCreateOptions } from './options/volume/VolumeCreateOptions.js';
10
+ import type { ContainerdVolumeInfo } from './types/ContainerdVolumeInfo.js';
11
+ import type { ContainerdPruneResult } from './types/ContainerdPruneResult.js';
12
+ import { VolumeStore, type Volume } from '../client/Volumes.js';
13
+ import { ImagePullOptions } from './options/image/ImagePullOptions.js';
14
+ import { ImageImportOptions } from './options/image/ImageImportOptions.js';
15
+ import { ImageExportOptions } from './options/image/ImageExportOptions.js';
16
+ import { ContainerCreateOptions } from './options/container/ContainerCreateOptions.js';
17
+ import { NetworkCreateOptions } from './options/network/NetworkCreateOptions.js';
18
+ import { ImageBuildOptions } from './options/image/ImageBuildOptions.js';
19
+ import type { ContainerdNetworkInfo } from './types/ContainerdNetworkInfo.js';
20
+ /**
21
+ * The containerd component: manages the images, containers, CNI networks and volumes of one containerd namespace by
22
+ * talking to containerd's gRPC socket directly, without a Docker daemon and without nerdctl. Use it on the Linux machines
23
+ * running containerd alone (embedded devices, servers without Docker); the application needs access to the socket (root,
24
+ * or a member of the group owning it). Register it in the `components` of an application (`{class: Containerd, ...}`)
25
+ * and get it with `getObject()` or `@Inject`; it is a singleton.
26
+ *
27
+ * Its API follows the Docker component's (`pullImage`, `createContainer`, `container.exec()`…). The containers it creates
28
+ * are nerdctl's: they carry nerdctl's labels (`nerdctl/name`…), so `nerdctl ps` lists them; containerd's shim writes
29
+ * their output to a log file and containerd's restart monitor applies their restart policy, also while the application
30
+ * is not running. The component pulls, pushes, imports and exports the images itself; it sends the builds to BuildKit
31
+ * (a local or remote `buildkitd`).
32
+ *
33
+ * The component connects when it is created: it fails with {@link ContainerdConnectionException} when containerd does
34
+ * not answer on `socketPath` (or `buildkitTLS` is given with a unix socket), and it creates its namespace when the
35
+ * namespace does not exist. BuildKit is only reached by
36
+ * the builds. When the component is destroyed, it ends its event streams, aborts its pulls, pushes and builds in
37
+ * progress, and closes its connections.
38
+ * @example
39
+ * ```typescript
40
+ * import {Application} from 'lakutata'
41
+ * import {Containerd, type ContainerdContainer, type ContainerdExecResult, type ContainerdImage} from 'lakutata/com/containerd'
42
+ *
43
+ * Application
44
+ * .run(() => ({
45
+ * id: 'device.app',
46
+ * name: 'Device',
47
+ * components: {
48
+ * containerd: {
49
+ * class: Containerd,
50
+ * socketPath: '/run/containerd/containerd.sock',
51
+ * namespace: 'default',
52
+ * registryAuths: {'registry.example.com': {username: 'deploy', password: 'secret'}}
53
+ * }
54
+ * },
55
+ * bootstrap: ['containerd']
56
+ * }))
57
+ * .onLaunched(async (app: Application): Promise<void> => {
58
+ * const containerd: Containerd = await app.getObject('containerd')
59
+ * //Pulled for the machine's platform, unpacked into the snapshotter
60
+ * const image: ContainerdImage = await containerd.pullImage({image: 'alpine:3.20'})
61
+ * const container: ContainerdContainer = await containerd.createContainer({
62
+ * image: image.name,
63
+ * name: 'worker',
64
+ * cmd: ['sleep', 'infinity'],
65
+ * //Restarted by containerd, even when the application is not running
66
+ * restartPolicy: 'always'
67
+ * })
68
+ * await container.start()
69
+ * const result: ContainerdExecResult = await container.exec({cmd: 'cat /etc/os-release'})
70
+ * console.log(result.exitCode, result.stdout)
71
+ * })
72
+ * ```
73
+ */
74
+ export declare class Containerd extends Component {
75
+ #private;
76
+ /**
77
+ * The path of containerd's gRPC socket.
78
+ * @default '/run/containerd/containerd.sock'
79
+ */
80
+ protected readonly socketPath: string;
81
+ /**
82
+ * The containerd namespace holding the component's images and containers: `default` is nerdctl's, `k8s.io` the one
83
+ * of Kubernetes. Letters, digits, `_`, `.` and `-`, starting with a letter or a digit; created when the component
84
+ * starts if it does not exist. The volumes are kept apart by namespace too.
85
+ * @default 'default'
86
+ */
87
+ protected readonly namespace: string;
88
+ /**
89
+ * The containerd snapshotter unpacking the images and holding the containers' root file systems: `overlayfs`, or
90
+ * `native` where overlayfs is not available.
91
+ * @default 'overlayfs'
92
+ */
93
+ protected readonly snapshotter: string;
94
+ /**
95
+ * The containerd runtime running the containers.
96
+ * @default 'io.containerd.runc.v2'
97
+ */
98
+ protected readonly runtime: string;
99
+ /**
100
+ * How runc manages the containers' cgroups: `cgroupfs`, or `systemd` when containerd's configuration sets
101
+ * `SystemdCgroup = true` for runc. It must match the machine's setup, or the containers fail to start.
102
+ * @default 'cgroupfs'
103
+ */
104
+ protected readonly cgroupManager: 'cgroupfs' | 'systemd';
105
+ /**
106
+ * The directory holding the component's files: each container's state (its log file, `hosts`, `resolv.conf`,
107
+ * `hostname` and the settings it was created with) under `containers/<namespace>/<id>`, the named volumes under
108
+ * `volumes/<namespace>`, and the temporary files of the builds and imports under `tmp`.
109
+ * @default '/var/lib/lakutata/containerd'
110
+ */
111
+ protected readonly dataRoot: string;
112
+ /**
113
+ * The size, in bytes, beyond which a container's log file is rotated when the component starts the container: the
114
+ * file is copied to `<log>.1` (replacing the previous copy) and emptied. Only checked at the starts made by the
115
+ * component, not at the restarts made by containerd's restart monitor. `0` never rotates.
116
+ * @default 0
117
+ */
118
+ protected readonly logMaxSize: number;
119
+ /**
120
+ * The directory of the CNI network configurations (`nerdctl-<name>.conflist`), shared with nerdctl.
121
+ * @default '/etc/cni/net.d'
122
+ */
123
+ protected readonly cniConfigPath: string;
124
+ /**
125
+ * The directories searched for the CNI plugins (`bridge`, `portmap`…); the ones that exist are used. A container
126
+ * joining a CNI network fails to be created when none of them exists.
127
+ * @default ['/opt/cni/bin', '/usr/lib/cni', '/usr/libexec/cni']
128
+ */
129
+ protected readonly cniPath: string[];
130
+ /**
131
+ * The address of the BuildKit daemon building the images: a unix socket (`unix:///run/buildkit/buildkitd.sock`, or
132
+ * an absolute path) or a remote daemon (`tcp://host:1234`). It is only reached by {@link Containerd.buildImage},
133
+ * {@link Containerd.buildkitVersion} and {@link Containerd.buildkitPlatforms}: the component starts without BuildKit.
134
+ * @default 'unix:///run/buildkit/buildkitd.sock'
135
+ */
136
+ protected readonly buildkitAddress: string;
137
+ /**
138
+ * Turns TLS on for a remote BuildKit (`tcp://`): `ca` verifies the daemon's certificate, `cert` and `key` are the
139
+ * client's certificate and key (PEM, as strings or buffers), `servername` is the name checked in the daemon's
140
+ * certificate (the address's host by default). Given with a unix socket address, it makes the component fail when it
141
+ * is created, with {@link ContainerdConnectionException}.
142
+ * @default none (plain TCP)
143
+ */
144
+ protected readonly buildkitTLS?: {
145
+ ca?: string | Buffer;
146
+ cert?: string | Buffer;
147
+ key?: string | Buffer;
148
+ servername?: string;
149
+ };
150
+ /**
151
+ * The registry credentials, by registry host (`docker.io`, `registry.example.com:5000`): a `username` and a
152
+ * `password`, or an `identityToken`. They are used by the pulls, the pushes and the base images of the builds; the
153
+ * `auth` option of a call replaces the credentials of its image's registry.
154
+ * @default none (anonymous access)
155
+ */
156
+ protected readonly registryAuths?: Record<string, RegistryCredentials>;
157
+ /**
158
+ * The registries reached over plain HTTP instead of HTTPS, by host (`localhost:5000`).
159
+ * @default none
160
+ */
161
+ protected readonly insecureRegistries?: string[];
162
+ /**
163
+ * Connect to containerd and create the namespace when it does not exist.
164
+ * @throws {ContainerdConnectionException} containerd does not answer on `socketPath` (not running, no access to the
165
+ * socket), or `buildkitTLS` is given with a unix socket `buildkitAddress`.
166
+ * @protected
167
+ */
168
+ protected init(): Promise<void>;
169
+ /**
170
+ * End the event streams, abort the pulls, pushes and builds in progress, and close the connections to containerd and
171
+ * BuildKit. The containers keep running.
172
+ * @protected
173
+ */
174
+ protected destroy(): Promise<void>;
175
+ /**
176
+ * Build the registry options of a pull, a push or a build: the configured credentials (`auth` replacing the ones of
177
+ * the reference's registry), the insecure registries, and the component's abort signal.
178
+ * @param reference The image reference whose registry gets `auth` (`registry.example.com/team/app:1.0`).
179
+ * @param auth The credentials of the reference's registry; ignored without `reference`.
180
+ * @returns The registry options.
181
+ * @protected
182
+ */
183
+ protected registryOptions(reference?: string, auth?: RegistryCredentials): RegistryOptions;
184
+ /** Containerd Common Operations **/
185
+ /**
186
+ * Get the version of containerd.
187
+ * @returns Its version (`1.7.36`, `v2.4.1`) and its git revision.
188
+ * @throws {GRPCError} containerd no longer answers (from `@lakutata/grpc`).
189
+ */
190
+ version(): Promise<{
191
+ version: string;
192
+ revision: string;
193
+ }>;
194
+ /**
195
+ * List the platforms this machine runs containers of: its own, and the ones of the emulators registered in
196
+ * `binfmt_misc` (QEMU, Rosetta), as detected when the component was created or by
197
+ * {@link Containerd.detectPlatforms}. An image is described for the first of its platforms in this list.
198
+ * @returns A copy of the list, formatted `os/architecture[/variant]` (`linux/arm64/v8`, `linux/amd64`).
199
+ */
200
+ supportedPlatforms(): string[];
201
+ /**
202
+ * Detect again the platforms this machine runs, after emulators were registered or removed in `binfmt_misc`.
203
+ * @returns The platforms detected, as {@link Containerd.supportedPlatforms} returns them from now on.
204
+ */
205
+ detectPlatforms(): string[];
206
+ /**
207
+ * Stream containerd's events in the component's namespace (`/tasks/exit`, `/containers/create`, `/images/delete`…)
208
+ * as they happen. The stream ends without an error when `signal` aborts or when the component is destroyed. The
209
+ * fields of the task, container, image and snapshot events are decoded; the other events have an empty `event`.
210
+ * @param signal Ends the stream when aborted; without it, the stream lasts as long as the component.
211
+ * @returns The events, in their order.
212
+ * @throws {GRPCError} The connection to containerd fails or is lost (from `@lakutata/grpc`).
213
+ */
214
+ events(signal?: AbortSignal): AsyncGenerator<ContainerdEvent>;
215
+ /** Containerd Image Operations **/
216
+ /**
217
+ * List the images of the namespace, each one described as {@link Containerd.getImage} does. The images whose content
218
+ * is not complete (a pull in progress, content collected) or that have none of their platforms' content are left
219
+ * out.
220
+ * @returns The images.
221
+ */
222
+ listImages(): Promise<ContainerdImage[]>;
223
+ /**
224
+ * Get an image present in containerd; it is not pulled. The image is described for the first platform it has among
225
+ * {@link Containerd.supportedPlatforms}, or for the first platform it has.
226
+ * @param name Its name or a reference, normalized as Docker does (`alpine` is `docker.io/library/alpine:latest`).
227
+ * @returns The image.
228
+ * @throws {ContainerdImageNotFoundException} No image has this name.
229
+ * @throws {ContainerdPlatformException} The content of none of its platforms is present.
230
+ */
231
+ getImage(name: string): Promise<ContainerdImage>;
232
+ /**
233
+ * Pull an image from its registry: the manifests of the platforms asked, their configurations and layers, then
234
+ * unpack the ones the machine runs ({@link Containerd.supportedPlatforms}) into the snapshotter so that containers
235
+ * can run them; the other platforms are only stored. The image is named by its normalized reference
236
+ * (`docker.io/library/alpine:3.20`); an image of the same name is replaced. The pull is aborted when the component
237
+ * is destroyed.
238
+ * @param options The reference, the platforms (the machine's by default, `'all'` for every one), the registry
239
+ * credentials (`auth`, else the `registryAuths` of its registry), `unpack` and the progress callback.
240
+ * @returns The image pulled.
241
+ * @throws {ContainerdPlatformException} The image has no manifest for one of the platforms asked.
242
+ * @throws {ContainerdImagePullException} The registry cannot be reached, refuses the credentials, or does not have
243
+ * the reference; the transfer fails or is aborted; the unpacking fails (the image is stored).
244
+ */
245
+ pullImage(options: ImagePullOptions): Promise<ContainerdImage>;
246
+ /**
247
+ * Get the version of the BuildKit daemon at `buildkitAddress`.
248
+ * @returns Its package (`github.com/moby/buildkit`), version and revision.
249
+ * @throws {ContainerdImageBuildException} BuildKit cannot be reached.
250
+ */
251
+ buildkitVersion(): Promise<{
252
+ package: string;
253
+ version: string;
254
+ revision: string;
255
+ }>;
256
+ /**
257
+ * List the platforms the BuildKit daemon builds for: the ones of its workers, including the emulators of its own
258
+ * machine.
259
+ * @returns The platforms, formatted `os/architecture[/variant]`.
260
+ * @throws {ContainerdImageBuildException} BuildKit cannot be reached.
261
+ */
262
+ buildkitPlatforms(): Promise<string[]>;
263
+ /**
264
+ * Build an image with BuildKit (the local or remote daemon at `buildkitAddress`), as `docker buildx build` does: the
265
+ * build context (without the files its `.dockerignore` excludes) and the Dockerfile are sent over a BuildKit session,
266
+ * then the image built is imported into containerd, named by `repoTag`, and pushed when `push` is set. The base
267
+ * images are pulled by BuildKit with the component's registry credentials (or `auth`). The build is aborted when the
268
+ * component is destroyed.
269
+ * @param options The context directory, the Dockerfile, the name, the platforms (the machine's by default), the build
270
+ * arguments, labels and target, `nocache`, `pull`, `push`, the credentials and the output callback.
271
+ * @returns The image built.
272
+ * @throws {ContainerdImageBuildException} BuildKit cannot be reached, the build fails, or its import fails.
273
+ * @throws {ContainerdImagePushException} With `push`, the push fails; the image is built and imported.
274
+ */
275
+ buildImage(options: ImageBuildOptions): Promise<ContainerdImage>;
276
+ /**
277
+ * Import the images of an archive: an OCI image layout (`nerdctl save`, `docker save` of Docker 25+, the archives of
278
+ * {@link Containerd.exportImages}) or an older `docker save` archive. The images are named as the archive names
279
+ * them (or by `name`, for an archive of one image), replace the images of the same names, and the platforms the
280
+ * machine runs ({@link Containerd.supportedPlatforms}) are unpacked unless `unpack: false`. The images of an OCI
281
+ * layout without a name annotation are not imported unless `name` is given.
282
+ * @param options The archive (a file path or a readable stream), the name to give, and `unpack`.
283
+ * @returns The images imported.
284
+ * @throws {ContainerdImageImportException} The archive cannot be read or is not an image archive; `name` is given
285
+ * with an archive of several images (nothing is imported); the unpacking fails (the images are stored and named).
286
+ */
287
+ importImage(options: ImageImportOptions): Promise<ContainerdImage[]>;
288
+ /**
289
+ * Export images into one archive: an OCI image layout with the `manifest.json` of `docker load`, loaded by
290
+ * `docker load`, `nerdctl load` and {@link Containerd.importImage}. The archive has the platforms each image has in
291
+ * containerd.
292
+ * @param names The names or references of the images (one at least).
293
+ * @param options The destination: a file path (created or replaced) or a writable stream.
294
+ * @throws {ContainerdImageNotFoundException} One of the images does not exist.
295
+ * @throws {ContainerdImageExportException} The archive cannot be written.
296
+ */
297
+ exportImages(names: string[], options: ImageExportOptions): Promise<void>;
298
+ /** Containerd Network Operations **/
299
+ /**
300
+ * Describe a CNI network.
301
+ * @param network The network, as read from its configuration file.
302
+ * @returns Its information.
303
+ * @protected
304
+ */
305
+ protected networkInfo(network: CNINetwork): ContainerdNetworkInfo;
306
+ /**
307
+ * List the networks: `host` and `none`, then the CNI networks of `cniConfigPath`, among them nerdctl's default
308
+ * `bridge` once it exists (it is created when a container or {@link Containerd.getNetwork} first asks for it).
309
+ * @returns The networks.
310
+ */
311
+ listNetworks(): Promise<ContainerdNetworkInfo[]>;
312
+ /**
313
+ * Get a network. Asking for `bridge` creates nerdctl's default network when it does not exist.
314
+ * @param nameOrId Its name, its identifier, or a prefix of its identifier (3 characters at least).
315
+ * @returns The network.
316
+ * @throws {ContainerdNetworkNotFoundException} No network matches.
317
+ */
318
+ getNetwork(nameOrId: string): Promise<ContainerdNetworkInfo>;
319
+ /**
320
+ * Create a CNI network as `nerdctl network create` does: its configuration `nerdctl-<name>.conflist` written in
321
+ * `cniConfigPath`, so nerdctl sees it. Its bridge and firewall rules are set up when the first container joins it.
322
+ * @param options Its name, driver (`bridge`, `macvlan`, `ipvlan`), IPv4 subnet (a free one of `10.4.0.0/16` by
323
+ * default), gateway and range, IPv6 subnet, parent interface, `internal`, MTU and labels.
324
+ * @returns The network created.
325
+ * @throws {ContainerdNetworkConflictException} The name is taken (`host`, `none` and `bridge` included), or the subnet
326
+ * overlaps another network's.
327
+ */
328
+ createNetwork(options: NetworkCreateOptions): Promise<ContainerdNetworkInfo>;
329
+ /**
330
+ * Remove a CNI network created by nerdctl or by the component, as `nerdctl network rm` does: its configuration, its
331
+ * bridge and the leases of its addresses.
332
+ * @param nameOrId Its name, its identifier, or a prefix of its identifier.
333
+ * @throws {ContainerdNetworkNotFoundException} No network matches (`host` and `none` included).
334
+ * @throws {ContainerdNetworkConflictException} A container of the namespace uses it, it is the default `bridge`, or
335
+ * it was not created by nerdctl (its configuration is left to remove by hand).
336
+ */
337
+ removeNetwork(nameOrId: string): Promise<void>;
338
+ /** Containerd Container Operations **/
339
+ /**
340
+ * List the containers of the namespace, running or not, the ones created by nerdctl included.
341
+ * @param labels Only the containers having all these labels with these values (`{app: 'web'}`); all of them by
342
+ * default.
343
+ * @returns The containers.
344
+ */
345
+ listContainers(labels?: Record<string, string>): Promise<ContainerdContainer[]>;
346
+ /**
347
+ * Get a container.
348
+ * @param idOrName Its identifier, its name, or a prefix of its identifier (3 hexadecimal characters at least).
349
+ * @returns The container, its information read from containerd.
350
+ * @throws {ContainerdContainerNotFoundException} No container matches.
351
+ * @throws {Error} The prefix matches several containers.
352
+ */
353
+ getContainer(idOrName: string): Promise<ContainerdContainer>;
354
+ /**
355
+ * Create a container of an image present in containerd (it is not pulled): its snapshot, its OCI specification and
356
+ * its state directory (log file, `hosts`, `resolv.conf`, `hostname`). The container is not started. It joins the
357
+ * default CNI network `bridge` by default (created when first used, the CNI plugins needed), as with Docker; `network:
358
+ * 'host'` gives it the host's network. Its `ports` are published on its first CNI network. Its system calls are filtered by containerd's default seccomp profile, unless it is privileged or
359
+ * `seccompProfile` says otherwise. The settings are kept so that {@link ContainerdContainer.update} can create it
360
+ * again.
361
+ * @param options The image and the container's settings (name, command, environment, user, mounts, devices,
362
+ * networks, ports, resources, restart policy…).
363
+ * @returns The container created.
364
+ * @throws {ContainerdImageNotFoundException} The image does not exist.
365
+ * @throws {ContainerdPlatformException} The image has no manifest for the platform asked (the machine's by default).
366
+ * @throws {ContainerdContainerNameConflictException} Another container has the name.
367
+ * @throws {ContainerdNetworkNotFoundException} One of the CNI networks does not exist.
368
+ * @throws {Error} The settings cannot be applied: ports without a CNI network, no command, no CNI plugin installed, a
369
+ * device or a seccomp profile file that cannot be read.
370
+ */
371
+ createContainer(options: ContainerCreateOptions): Promise<ContainerdContainer>;
372
+ /**
373
+ * Replace a container by a new one created with other settings, as {@link ContainerdContainer.update} does: the old
374
+ * container is renamed, the new one created with `options`, then the old one removed by force, and the new one
375
+ * started when the old one was running or paused. When the creation fails, the old container gets its name back
376
+ * and keeps running.
377
+ * @param record The containerd record of the container to replace.
378
+ * @param options The complete settings of the new container.
379
+ * @returns The new container.
380
+ * @throws {ContainerdContainerNotFoundException} The container no longer exists.
381
+ * @throws {ContainerdImageNotFoundException} From the creation, as {@link Containerd.createContainer} throws.
382
+ */
383
+ recreateContainer(record: Message, options: ContainerCreateOptions): Promise<ContainerdContainer>;
384
+ /** Containerd Volume Operations **/
385
+ /**
386
+ * Describe a named volume.
387
+ * @param volume The volume, as read from its directory.
388
+ * @returns Its information.
389
+ * @protected
390
+ */
391
+ protected volumeInfo(volume: Volume): ContainerdVolumeInfo;
392
+ /**
393
+ * The store of the namespace's named volumes, under `<dataRoot>/volumes/<namespace>`.
394
+ * @protected
395
+ */
396
+ protected get volumes(): VolumeStore;
397
+ /**
398
+ * List the containers mounting a volume, running or not.
399
+ * @param name The volume's name.
400
+ * @returns The names of the containers.
401
+ * @protected
402
+ */
403
+ protected volumeUsers(name: string): Promise<string[]>;
404
+ /**
405
+ * List the named volumes of the namespace, sorted by name.
406
+ * @returns The volumes.
407
+ */
408
+ listVolumes(): Promise<ContainerdVolumeInfo[]>;
409
+ /**
410
+ * Get a named volume.
411
+ * @param name The volume's name.
412
+ * @returns The volume: its host directory (`mountpoint`), labels and creation time.
413
+ * @throws {ContainerdVolumeNotFoundException} The volume does not exist, or the name is not a valid one.
414
+ */
415
+ getVolume(name: string): Promise<ContainerdVolumeInfo>;
416
+ /**
417
+ * Create a named volume: a directory under `dataRoot` that containers mount by name. As Docker does, a volume that
418
+ * exists is returned unchanged (its labels are not updated). A container mounting a missing volume creates it too.
419
+ * @param options The name (letters, digits, `_`, `.` and `-`) and the labels.
420
+ * @returns The volume.
421
+ */
422
+ createVolume(options: VolumeCreateOptions): Promise<ContainerdVolumeInfo>;
423
+ /**
424
+ * Remove a named volume and its data.
425
+ * @param name The volume's name.
426
+ * @throws {ContainerdVolumeNotFoundException} The volume does not exist.
427
+ * @throws {ContainerdVolumeInUseException} A container of the namespace mounts it, even a stopped one.
428
+ */
429
+ removeVolume(name: string): Promise<void>;
430
+ /** Containerd Common Operations **/
431
+ /**
432
+ * Remove the unused resources of the namespace, in this order: the containers that are not running (created or
433
+ * exited), the images no container uses (the dangling ones, without a tag, or all of them with `allImages`), the CNI
434
+ * networks no container uses (except the default `bridge` and the ones nerdctl did not create), and the volumes no
435
+ * container mounts. A container, image, network or volume that fails to be removed is skipped (left out of the
436
+ * result).
437
+ * @param options What to remove: `containers` and `images` by default, `allImages`, `networks` and `volumes` when
438
+ * set.
439
+ * @returns The names (identifiers of the containers) of what was removed.
440
+ */
441
+ prune(options?: ContainerdPruneOptions): Promise<ContainerdPruneResult>;
442
+ }