@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,149 @@
1
+ import { Provider } from '@lakutata/core';
2
+ import { Time } from '@lakutata/utils/Time';
3
+ import type { ImageStore } from '../../client/ImageStore.js';
4
+ import type { RegistryOptions } from '../../client/Registry.js';
5
+ import { type Containerd } from '../Containerd.js';
6
+ import type { ContainerdImageConfig } from '../types/ContainerdImageConfig.js';
7
+ import { ImagePushOptions } from '../options/image/ImagePushOptions.js';
8
+ import { ImageExportOptions } from '../options/image/ImageExportOptions.js';
9
+ /**
10
+ * An image of the {@link Containerd} component's namespace: its name, digest, platforms, size and configuration, and
11
+ * the operations tag, push, export and remove. Get it from {@link Containerd.getImage}, {@link Containerd.listImages},
12
+ * {@link Containerd.pullImage}, {@link Containerd.buildImage}, {@link Containerd.importImage} or
13
+ * {@link ContainerdContainer.commit}; do not create it yourself. Each call returns a new object (transient).
14
+ *
15
+ * An image may hold several platforms (an index): the object describes one of them, the first one the machine runs
16
+ * ({@link Containerd.supportedPlatforms}), or the first one present. Its properties are a snapshot taken when it was
17
+ * obtained; {@link ContainerdImage.syncImageInfo} takes a new one.
18
+ * @example
19
+ * ```typescript
20
+ * import {type Containerd, type ContainerdImage} from 'lakutata/com/containerd'
21
+ *
22
+ * declare const containerd: Containerd
23
+ *
24
+ * const image: ContainerdImage = await containerd.pullImage({image: 'alpine:3.20', platform: ['linux/amd64', 'linux/arm64']})
25
+ * //docker.io/library/alpine:3.20, its platforms, the command its containers run
26
+ * console.log(image.name, image.platforms, image.config.cmd)
27
+ * const tagged: ContainerdImage = await image.tag('registry.example.com/team/alpine:3.20')
28
+ * await tagged.push({auth: {username: 'deploy', password: 'secret'}})
29
+ * //An archive loaded by docker load and nerdctl load
30
+ * await image.export({destination: '/tmp/alpine.tar'})
31
+ * await tagged.remove()
32
+ * ```
33
+ */
34
+ export declare class ContainerdImage extends Provider {
35
+ /**
36
+ * Gives the component's image store; set by the component.
37
+ */
38
+ protected readonly getStore: () => ImageStore;
39
+ /**
40
+ * Gives the component that created the object.
41
+ */
42
+ protected readonly getContainerd: () => Containerd;
43
+ /**
44
+ * Gives the component's registry options (credentials, insecure registries) for the pushes.
45
+ */
46
+ protected readonly getRegistryOptions: () => RegistryOptions;
47
+ /**
48
+ * The image's name, normalized as Docker does (`docker.io/library/alpine:3.20`).
49
+ */
50
+ name: string;
51
+ /**
52
+ * The digest of the image's target: its index for a multi-platform image, else its manifest (`sha256:…`), as a
53
+ * registry knows it.
54
+ */
55
+ digest: string;
56
+ /**
57
+ * The media type of the image's target: an OCI or Docker index, or a manifest.
58
+ */
59
+ mediaType: string;
60
+ /**
61
+ * The labels of the image's containerd record (not the ones of its configuration: see `config.labels`).
62
+ */
63
+ labels: Record<string, string>;
64
+ /**
65
+ * When the image was created in containerd (pulled, imported, built).
66
+ */
67
+ createdAt: Time;
68
+ /**
69
+ * When the image's record was last updated in containerd (pulled again, tagged over).
70
+ */
71
+ updatedAt: Time;
72
+ /**
73
+ * The platforms whose content is present (the ones pulled), formatted `os/architecture[/variant]`.
74
+ */
75
+ platforms: string[];
76
+ /**
77
+ * The platform the object describes: the first one the machine runs, or the first one present.
78
+ */
79
+ platform: string;
80
+ /**
81
+ * The operating system of the platform described (`linux`).
82
+ */
83
+ os: string;
84
+ /**
85
+ * The architecture of the platform described (`amd64`, `arm64`).
86
+ */
87
+ arch: string;
88
+ /**
89
+ * The variant of the platform described (`v8`, `v7`); `undefined` when it has none.
90
+ */
91
+ variant: string | undefined;
92
+ /**
93
+ * The size of the platform described, in bytes: its configuration and its compressed layers.
94
+ */
95
+ size: number;
96
+ /**
97
+ * The configuration the image gives its containers, for the platform described: environment, command, entry point,
98
+ * working directory, user, exposed ports, volumes, labels and stop signal.
99
+ */
100
+ config: ContainerdImageConfig;
101
+ /**
102
+ * Read the image's information.
103
+ * @throws {ContainerdImageNotFoundException} The image does not exist.
104
+ * @throws {ContainerdPlatformException} The content of none of its platforms is present.
105
+ * @protected
106
+ */
107
+ protected init(): Promise<void>;
108
+ /**
109
+ * Read the image's information again from containerd into the object's properties.
110
+ * @throws {ContainerdImageNotFoundException} The image no longer exists.
111
+ * @throws {ContainerdPlatformException} The content of none of its platforms is present.
112
+ */
113
+ syncImageInfo(): Promise<void>;
114
+ /**
115
+ * Give the image another name, as `docker tag` does: a new image record with the same content. An image that has
116
+ * this name already is replaced. This object keeps its name.
117
+ * @param name The new name or reference (`registry.example.com/team/alpine:3.20`), normalized as Docker does.
118
+ * @returns The image under its new name.
119
+ * @throws {ContainerdImageNotFoundException} The image no longer exists.
120
+ */
121
+ tag(name: string): Promise<ContainerdImage>;
122
+ /**
123
+ * Push the image to its registry, or to another reference. With `platform`, only the manifest of that platform is
124
+ * pushed under the tag. Without it, when the content of all the platforms of its index is present, all of them and
125
+ * the index are pushed; otherwise only the manifest of the machine's platform. The credentials are `auth`, else the
126
+ * component's `registryAuths`. The push is aborted when the component is destroyed.
127
+ * @param options The `reference` to push to (the image's name by default), the `platform`, the credentials and the
128
+ * progress callback.
129
+ * @throws {ContainerdImageNotFoundException} The image no longer exists.
130
+ * @throws {ContainerdPlatformException} The platform to push (`platform`, or the machine's when only some platforms
131
+ * are present) is not present.
132
+ * @throws {ContainerdImagePushException} The registry cannot be reached or refuses the push (credentials, rights).
133
+ */
134
+ push(options?: ImagePushOptions): Promise<void>;
135
+ /**
136
+ * Export the image into an archive: an OCI image layout with the `manifest.json` of `docker load`, loaded by
137
+ * `docker load`, `nerdctl load` and {@link Containerd.importImage}.
138
+ * @param options The destination: a file path (created or replaced) or a writable stream.
139
+ * @throws {ContainerdImageNotFoundException} The image no longer exists.
140
+ * @throws {ContainerdImageExportException} The archive cannot be written.
141
+ */
142
+ export(options: ImageExportOptions): Promise<void>;
143
+ /**
144
+ * Remove the image's name. Its content and snapshots are collected by containerd once no other image and no
145
+ * container uses them; the containers of the image keep working.
146
+ * @throws {ContainerdImageNotFoundException} The image no longer exists.
147
+ */
148
+ remove(): Promise<void>;
149
+ }
@@ -0,0 +1,44 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * What {@link Containerd.prune} removes; every field is optional. A resource whose removal fails is skipped. Unlike the
4
+ * Docker component's options, the volumes are kept by default, and `allImages` removes the tagged images too.
5
+ * @example
6
+ * ```typescript
7
+ * import {Containerd} from 'lakutata/com/containerd'
8
+ *
9
+ * declare const containerd: Containerd
10
+ *
11
+ * //The stopped containers and the dangling images (the defaults), and the unused volumes with their data
12
+ * const removed = await containerd.prune({volumes: true})
13
+ * console.log(removed.containers, removed.images, removed.volumes)
14
+ * ```
15
+ */
16
+ export declare class ContainerdPruneOptions extends DTO {
17
+ /**
18
+ * Remove the containers which do not run (their status `'created'` or `'exited'`), with their snapshots and their
19
+ * logs.
20
+ * @default true
21
+ */
22
+ containers?: boolean;
23
+ /**
24
+ * Remove the dangling images (named by a digest, without a tag) no container uses.
25
+ * @default true
26
+ */
27
+ images?: boolean;
28
+ /**
29
+ * Remove all the images no container uses, the tagged ones too (whatever `images` is).
30
+ * @default false
31
+ */
32
+ allImages?: boolean;
33
+ /**
34
+ * Remove the networks no container uses, among the ones created by nerdctl or the component; never `host`, `none`
35
+ * nor the default `bridge` network.
36
+ * @default false
37
+ */
38
+ networks?: boolean;
39
+ /**
40
+ * Remove the volumes no container uses, with their data.
41
+ * @default false
42
+ */
43
+ volumes?: boolean;
44
+ }
@@ -0,0 +1,32 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * The credentials of a container registry, given to a pull, a push or a build (their `auth` option) for the registry
4
+ * of the reference they name. They replace, for that operation, the ones the component's `registryAuths` option gives
5
+ * that registry. Every field is optional; without `username` nor `identityToken`, the registry is accessed anonymously.
6
+ * @example
7
+ * ```typescript
8
+ * import {Containerd} from 'lakutata/com/containerd'
9
+ *
10
+ * declare const containerd: Containerd
11
+ *
12
+ * await containerd.pullImage({
13
+ * image: 'registry.example.com:5000/team/app:1.0',
14
+ * auth: {username: 'ci', password: process.env.REGISTRY_TOKEN ?? ''}
15
+ * })
16
+ * ```
17
+ */
18
+ export declare class ContainerdRegistryAuthOptions extends DTO {
19
+ /**
20
+ * The user name, sent with `password` (HTTP basic authentication, or the registry's token service).
21
+ */
22
+ username?: string;
23
+ /**
24
+ * The password of `username`, or an access token the registry accepts as one; ignored without `username`.
25
+ */
26
+ password?: string;
27
+ /**
28
+ * An identity token (the OAuth2 refresh token the registry issued, as `docker login` stores it), exchanged with the
29
+ * registry's token service for an access token instead of `username` and `password`.
30
+ */
31
+ identityToken?: string;
32
+ }
@@ -0,0 +1,57 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * How {@link ContainerdContainer.commit} saves a container's file system changes as a new image: one layer on its
4
+ * image, for the container's platform, with the image configuration changed as asked; the image is unpacked so it can
5
+ * run at once. Every field is optional. Unlike the Docker component's options, the image configuration can be changed
6
+ * and the commit commented, and an image committed without `repoTag` is still named.
7
+ * @example
8
+ * ```typescript
9
+ * import {Containerd} from 'lakutata/com/containerd'
10
+ *
11
+ * declare const containerd: Containerd
12
+ *
13
+ * const container = await containerd.getContainer('builder')
14
+ * const image = await container.commit({
15
+ * repoTag: 'registry.example.com/app:1.1',
16
+ * changes: {cmd: ['node', 'server.js'], env: {NODE_ENV: 'production'}, exposedPorts: ['3000/tcp']},
17
+ * comment: 'Dependencies installed',
18
+ * author: 'CI <ci@example.com>'
19
+ * })
20
+ * console.log(image.name, image.digest)
21
+ * ```
22
+ */
23
+ export declare class ContainerCommitOptions extends DTO {
24
+ /**
25
+ * The name of the new image (`'app:1.1'`, normalized to `'docker.io/library/app:1.1'`). By default, the
26
+ * container's image repository with the tag `commit-<milliseconds since the epoch>`.
27
+ */
28
+ repoTag?: string;
29
+ /**
30
+ * Pause a running container while its changes are read, so that they are consistent; it is resumed after, even on
31
+ * a failure.
32
+ * @default true
33
+ */
34
+ pauseBeforeCommitting?: boolean;
35
+ /**
36
+ * The changes of the new image's configuration, every field optional: `cmd` and `entrypoint` replace the image's
37
+ * ones; `env` adds variables (replacing them by name); `workingDir` and `user` replace the image's ones; `labels`
38
+ * are added; `exposedPorts` adds ports as `"8080"` (TCP) or `"8080/udp"` (`tcp`, `udp` or `sctp`).
39
+ */
40
+ changes?: {
41
+ cmd?: string[];
42
+ entrypoint?: string[];
43
+ env?: Record<string, string>;
44
+ workingDir?: string;
45
+ user?: string;
46
+ labels?: Record<string, string>;
47
+ exposedPorts?: string[];
48
+ };
49
+ /**
50
+ * The comment of the commit, written to the image history.
51
+ */
52
+ comment?: string;
53
+ /**
54
+ * The author of the commit (`'Name <email>'`), written to the image configuration and its history.
55
+ */
56
+ author?: string;
57
+ }
@@ -0,0 +1,273 @@
1
+ import { DTO } from '@lakutata/core';
2
+ import type { ContainerdRestartPolicy } from '../../types/ContainerdRestartPolicy.js';
3
+ import type { ContainerdBind } from '../../types/ContainerdBind.js';
4
+ import type { ContainerdDevice } from '../../types/ContainerdDevice.js';
5
+ import type { ContainerdTmpfs } from '../../types/ContainerdTmpfs.js';
6
+ import type { ContainerdVolume } from '../../types/ContainerdVolume.js';
7
+ /**
8
+ * The settings of a container created by {@link Containerd.createContainer}: its image, its process, its mounts, its
9
+ * networks, its resources and its security. Only `image` is required; the container is created stopped (`start()` it)
10
+ * as a nerdctl container (`nerdctl ps` lists it), with an OCI runtime specification built as nerdctl builds it. The
11
+ * component keeps these settings: {@link ContainerdContainer.update} creates the container again with the ones it
12
+ * changes.
13
+ *
14
+ * As with the Docker component, the container joins the default network `bridge` unless `network` or `networks` is
15
+ * given (here a CNI network, the CNI plugins needed); its ports are published only on a CNI network, and its named volumes are directories the component keeps (not Docker's nor
16
+ * nerdctl's volumes).
17
+ * @example
18
+ * ```typescript
19
+ * import {Containerd} from 'lakutata/com/containerd'
20
+ *
21
+ * declare const containerd: Containerd
22
+ *
23
+ * await containerd.pullImage({image: 'nginx:1.27'})
24
+ * const container = await containerd.createContainer({
25
+ * image: 'nginx:1.27',
26
+ * name: 'web',
27
+ * env: {NGINX_PORT: '80'},
28
+ * binds: [{hostPath: '/srv/www', containerPath: '/usr/share/nginx/html', rw: false}],
29
+ * volumes: [{volumeName: 'web-cache', containerPath: '/var/cache/nginx'}],
30
+ * //The default nerdctl network, its port 80 published on the host port 8080
31
+ * networks: [{networkName: 'bridge'}],
32
+ * ports: [{port: 80, hostPorts: [8080]}],
33
+ * memoryLimit: 256 * 1024 * 1024,
34
+ * cpus: 0.5,
35
+ * restartPolicy: 'unless-stopped'
36
+ * })
37
+ * await container.start()
38
+ * ```
39
+ */
40
+ export declare class ContainerCreateOptions extends DTO {
41
+ /**
42
+ * The image of the container: its name or a reference (`'alpine:3.20'`, `'docker.io/library/alpine:3.20'`,
43
+ * `'registry.example.com/app@sha256:…'`). Required. The image must be in containerd already (pull, import or build
44
+ * it first): a missing one throws {@link ContainerdImageNotFoundException}.
45
+ */
46
+ image: string;
47
+ /**
48
+ * The platform of the image run (`'linux/amd64'`, `'linux/arm/v7'`, or `'arm64'` for `linux/arm64`), pulled
49
+ * beforehand; another architecture than the machine's needs a QEMU emulator registered in binfmt_misc
50
+ * ({@link Containerd.supportedPlatforms}). The machine's platform by default; an image without it throws
51
+ * {@link ContainerdPlatformException}.
52
+ */
53
+ platform?: string;
54
+ /**
55
+ * The name of the container, matching `[a-zA-Z0-9][a-zA-Z0-9_.-]*` and unique in the namespace (a name in use
56
+ * throws {@link ContainerdContainerNameConflictException}). By default, the last part of the image name and the
57
+ * first 5 hexadecimal digits of the container ID (`'nginx-3fa2c'`).
58
+ */
59
+ name?: string;
60
+ /**
61
+ * The host name of the container, written to its `/etc/hostname` and its `HOSTNAME` variable. By default, the
62
+ * host's name on the host network, the first 12 digits of the container ID otherwise.
63
+ */
64
+ hostname?: string;
65
+ /**
66
+ * The command of the container, its arguments (`['nginx', '-g', 'daemon off;']`), run after the entry point. The
67
+ * image's command by default; dropped when `entrypoint` is given without it (as Docker does).
68
+ */
69
+ cmd?: string[];
70
+ /**
71
+ * The entry point of the container, its arguments, replacing the image's; `['']` removes the image's entry point.
72
+ * The image's entry point by default. A container left with neither an entry point nor a command fails to be
73
+ * created.
74
+ */
75
+ entrypoint?: string[];
76
+ /**
77
+ * The environment variables of the container, added to the image's ones (and replacing them by name). The
78
+ * container also gets `HOSTNAME`, and `PATH` and `HOME` (the user's home directory) when the image has none.
79
+ */
80
+ env?: Record<string, string>;
81
+ /**
82
+ * The working directory of the container's process; the image's one by default, `/` without it.
83
+ */
84
+ workingDir?: string;
85
+ /**
86
+ * The user of the container's process: `'user'`, `'user:group'`, `'uid'` or `'uid:gid'`, the names resolved by
87
+ * the image's `/etc/passwd` and `/etc/group`. The image's user by default, root without it.
88
+ */
89
+ user?: string;
90
+ /**
91
+ * The labels of the container, added to the image's ones; the ones the component sets (`nerdctl/…`,
92
+ * `containerd.io/restart.…`) cannot be overridden. {@link Containerd.listContainers} filters by them.
93
+ */
94
+ labels?: Record<string, string>;
95
+ /**
96
+ * Give the container all the capabilities, access to every device by its cgroup, the host's devices in its `/dev`
97
+ * (the character and block devices of the host's `/dev` when the container is created, as nerdctl gives them; a
98
+ * device plugged later needs a bind of `/dev`), `/sys` and `/sys/fs/cgroup` writable, no masked paths, no seccomp
99
+ * filter and no `no_new_privs`.
100
+ * @default false
101
+ */
102
+ privileged?: boolean;
103
+ /**
104
+ * Mount the container's root file system read only (its mounts, tmpfs and volumes stay writable).
105
+ * @default false
106
+ */
107
+ readonlyRootfs?: boolean;
108
+ /**
109
+ * The Linux capabilities added to the default ones (the 14 Docker gives: `CHOWN`, `DAC_OVERRIDE`, `FSETID`,
110
+ * `FOWNER`, `MKNOD`, `NET_RAW`, `SETGID`, `SETUID`, `SETFCAP`, `SETPCAP`, `NET_BIND_SERVICE`, `SYS_CHROOT`, `KILL`,
111
+ * `AUDIT_WRITE`), with or without the `CAP_` prefix, in any case (`'NET_ADMIN'`, `'cap_sys_time'`); `'ALL'` adds
112
+ * them all. Added after `capabilitiesDrop` is applied. Unlike the Docker component, the names are not checked
113
+ * against a list.
114
+ */
115
+ capabilities?: string[];
116
+ /**
117
+ * The Linux capabilities removed from the default ones, with or without the `CAP_` prefix (`'NET_RAW'`); `'ALL'`
118
+ * removes them all, before `capabilities` adds its ones.
119
+ */
120
+ capabilitiesDrop?: string[];
121
+ /**
122
+ * The seccomp profile filtering the system calls of the container: `'default'`, the default profile of containerd
123
+ * and nerdctl (the system calls allowed by the container's capabilities), applied when the kernel supports seccomp;
124
+ * `'unconfined'`, no filter; or the path of a JSON file holding an OCI seccomp profile (the `linux.seccomp` object
125
+ * of a runtime specification), read when the container is created. Privileged containers have no filter.
126
+ * @default 'default'
127
+ */
128
+ seccompProfile?: 'default' | 'unconfined' | string;
129
+ /**
130
+ * The host directories and files mounted into the container. Each needs `hostPath` and `containerPath`; `rw`
131
+ * defaults to `true`, `propagation` to `'rprivate'`.
132
+ */
133
+ binds?: ContainerdBind[];
134
+ /**
135
+ * The named volumes mounted into the container, created empty when they do not exist ({@link ContainerdVolume}).
136
+ * Each needs `volumeName` (`[a-zA-Z0-9][a-zA-Z0-9_.-]*`) and `containerPath`.
137
+ */
138
+ volumes?: ContainerdVolume[];
139
+ /**
140
+ * The tmpfs mounted into the container ({@link ContainerdTmpfs}). Each needs `containerPath`; `size` is a positive
141
+ * integer of bytes, `mode` three or four octal digits.
142
+ */
143
+ tmpfs?: ContainerdTmpfs[];
144
+ /**
145
+ * The host devices given to the container ({@link ContainerdDevice}): a device node, or a directory of them. Each
146
+ * needs `hostPath`; `cgroupPermissions` is one to three of `r`, `w` and `m`, each at most once, in any order
147
+ * (`'rw'`, `'mr'`), `'rwm'` by default.
148
+ */
149
+ devices?: ContainerdDevice[];
150
+ /**
151
+ * The devices the container's cgroup allows besides the ones given, as Docker's `--device-cgroup-rule` writes them:
152
+ * a type (`c` character, `b` block, `a` all), the major and minor numbers or `*`, the access (one to three of `r`,
153
+ * `w`, `m`, each at most once): `"c 188:* rwm"` for the USB serial ports. They let the container use the devices
154
+ * plugged after its start, with a bind of `/dev` (or of `/dev/serial`, `/dev/bus/usb`).
155
+ */
156
+ deviceCgroupRules?: string[];
157
+ /**
158
+ * The network of a container without `networks`: `'host'`, the host's network stack, or `'none'`, a network
159
+ * namespace with only its loopback. Ignored when `networks` is given. Without both, the container joins the default
160
+ * CNI network `bridge`, as with Docker and nerdctl (its ports published there; the CNI plugins needed).
161
+ * @default the network `bridge`
162
+ */
163
+ network?: 'host' | 'none';
164
+ /**
165
+ * The CNI networks the container joins, in order (its interfaces `eth0`, `eth1`…): `'bridge'`, the default nerdctl
166
+ * network (`10.4.0.0/24`, created when first used), or one created by {@link Containerd.createNetwork}. Each needs
167
+ * `networkName`, of an existing network other than `host` and `none` (a missing one throws
168
+ * {@link ContainerdNetworkNotFoundException}), given once; `ip` and `ipv6` set its address on the network (`''` or
169
+ * absent: one given by the network's IPAM). Requires the CNI plugins in the component's `cniPath`.
170
+ */
171
+ networks?: {
172
+ networkName: string;
173
+ ip?: string;
174
+ ipv6?: string;
175
+ }[];
176
+ /**
177
+ * The container ports published on the host, by the CNI `portmap` plugin on its first network: it needs `networks`
178
+ * (ports on the host or `none` network fail the creation). Each needs `port`, the container port, and `hostPorts`,
179
+ * one or more host ports forwarding to it; `type` is `'tcp'` (the default), `'udp'` or `'sctp'`; `hostIP` limits
180
+ * them to one host address (all of them by default). Unlike the Docker component, `hostPorts` is required and
181
+ * `type` is optional.
182
+ */
183
+ ports?: {
184
+ port: number;
185
+ type?: 'tcp' | 'udp' | 'sctp';
186
+ hostPorts: number[];
187
+ hostIP?: string;
188
+ }[];
189
+ /**
190
+ * `'host'` shares the host's PID namespace (the container sees the host processes); a namespace of its own when
191
+ * not given.
192
+ */
193
+ pidMode?: 'host';
194
+ /**
195
+ * `'host'` shares the host's IPC namespace (its shared memory and message queues); a namespace of its own when not
196
+ * given.
197
+ */
198
+ ipcMode?: 'host';
199
+ /**
200
+ * The cgroup namespace: `'private'`, one of its own (its cgroup seen as the root of its `/sys/fs/cgroup`), applied
201
+ * on cgroup v2 hosts only; `'host'`, the host's one.
202
+ * @default 'private'
203
+ */
204
+ cgroupns?: 'private' | 'host';
205
+ /**
206
+ * The memory limit in bytes, a non-negative integer; `0` or absent for no limit. With it, the swap is limited too
207
+ * (see `memorySwap`).
208
+ */
209
+ memoryLimit?: number;
210
+ /**
211
+ * The limit of the memory and the swap together in bytes, as Docker's and nerdctl's `--memory-swap`: at least
212
+ * `memoryLimit` (equal to it, no swap), or `-1` for unlimited swap. `0` or absent with `memoryLimit`: twice
213
+ * `memoryLimit` (as much swap as memory). A positive value needs `memoryLimit`: without it, the options are
214
+ * refused. Discarded when the kernel does not limit the swap of the cgroups (as Docker discards it).
215
+ */
216
+ memorySwap?: number;
217
+ /**
218
+ * The CPUs the container uses at most, a positive number (`1.5`): a CFS quota of `cpus × 100000` µs per period of
219
+ * 100000 µs. No limit by default.
220
+ */
221
+ cpus?: number;
222
+ /**
223
+ * The relative CPU weight of the container against the others when the CPUs are busy, in cgroup v1 CPU shares
224
+ * (`1024` is the kernel's default; runc converts them to a `cpu.weight` on cgroup v2). A positive integer; the
225
+ * kernel's default when not given.
226
+ */
227
+ cpuShares?: number;
228
+ /**
229
+ * The CPUs the container may run on, by their numbers (`[0, 1]`); all of them by default.
230
+ */
231
+ cpuSet?: number[];
232
+ /**
233
+ * The processes (and threads) the container may have at most, a positive integer; no limit by default.
234
+ */
235
+ pidsLimit?: number;
236
+ /**
237
+ * Disable the kernel's OOM killer for the container: its processes wait for memory instead of being killed at its
238
+ * memory limit. Supported on cgroup v1 only.
239
+ * @default false
240
+ */
241
+ OOMKillDisable?: boolean;
242
+ /**
243
+ * The kernel parameters set in the container's namespaces (`{'net.ipv4.ip_forward': '1'}`); runc accepts only the
244
+ * namespaced ones (`net.*` outside the host network, `kernel.shm*`, `kernel.msg*`, `fs.mqueue.*`…).
245
+ */
246
+ sysctls?: Record<string, string>;
247
+ /**
248
+ * The size of the container's `/dev/shm` in bytes, a positive integer.
249
+ * @default 67108864
250
+ */
251
+ shmSize?: number;
252
+ /**
253
+ * The restart policy, applied by containerd's restart monitor ({@link ContainerdRestartPolicy}): `''` or `'no'`,
254
+ * `'always'`, `'unless-stopped'`, `'on-failure'`, `'on-failure:N'`. Never restarted by default.
255
+ */
256
+ restartPolicy?: ContainerdRestartPolicy;
257
+ /**
258
+ * The signal `stop()` sends first (`'SIGTERM'`, `'SIGQUIT'`, `'TERM'`, `'15'`); the image's stop signal by default,
259
+ * `SIGTERM` without it.
260
+ */
261
+ stopSignal?: string;
262
+ /**
263
+ * The host names added to the container's `/etc/hosts`, each mapped to an IP address
264
+ * (`{'db.local': '10.4.1.5'}`).
265
+ */
266
+ extraHosts?: Record<string, string>;
267
+ /**
268
+ * The IP addresses of the name servers of the container's `/etc/resolv.conf`, replacing the host's. By default,
269
+ * the host's `/etc/resolv.conf`, without its loopback name servers outside the host network (and with `8.8.8.8`
270
+ * and `8.8.4.4` when none is left, as Docker does).
271
+ */
272
+ dns?: string[];
273
+ }
@@ -0,0 +1,53 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * A command {@link ContainerdContainer.exec} runs in a running container (else it throws
4
+ * {@link ContainerdContainerStateException}), waiting for its exit and capturing its output in memory. Only `cmd` is
5
+ * required; the process gets the container's settings (environment, user, capabilities) unless changed here.
6
+ * Separating its standard error and giving it a standard input use FIFOs (`mkfifo` on the host). Unlike the Docker
7
+ * component's options, a string `cmd` is run by a shell, the process can get an environment, a user, a standard input
8
+ * and a timeout, and the result holds the exit code and the two outputs apart.
9
+ * @example
10
+ * ```typescript
11
+ * import {Containerd} from 'lakutata/com/containerd'
12
+ *
13
+ * declare const containerd: Containerd
14
+ *
15
+ * const container = await containerd.getContainer('db')
16
+ * const result = await container.exec({
17
+ * cmd: ['psql', '-U', 'postgres', '-f', '-'],
18
+ * stdin: 'SELECT 1;',
19
+ * timeout: 30000
20
+ * })
21
+ * if (result.exitCode !== 0) console.error(result.stderr)
22
+ * ```
23
+ */
24
+ export declare class ContainerExecOptions extends DTO {
25
+ /**
26
+ * The command: its arguments (`['ls', '-la', '/data']`, at least one), or a command line run by `/bin/sh -c`
27
+ * (`'ls -la /data | wc -l'`), which needs a shell in the container. Required.
28
+ */
29
+ cmd: string | string[];
30
+ /**
31
+ * Its environment variables, added to the container's ones (and replacing them by name).
32
+ */
33
+ env?: Record<string, string>;
34
+ /**
35
+ * Its working directory; the container's one by default.
36
+ */
37
+ workingDir?: string;
38
+ /**
39
+ * Its user: `'user'`, `'user:group'`, `'uid'` or `'uid:gid'`, the names resolved by the container's `/etc/passwd`
40
+ * and `/etc/group`; the container's user by default.
41
+ */
42
+ user?: string;
43
+ /**
44
+ * The data written to its standard input, which is closed after it. Without it, the process has no standard input.
45
+ * Needs `mkfifo` on the host.
46
+ */
47
+ stdin?: string | Buffer;
48
+ /**
49
+ * The milliseconds it may run, a positive integer: it is then killed (`SIGKILL`) and the result has its exit code
50
+ * (`137`) and its output so far. No limit by default.
51
+ */
52
+ timeout?: number;
53
+ }
@@ -0,0 +1,32 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * What {@link ContainerdContainer.exportDirectory} archives (as tar) and where. A running container is read through
4
+ * its process root (its mounts included), a stopped one from its snapshot (its image layers and its changes, without
5
+ * its mounts). The directories, regular files and symbolic links are archived with their modes, owners and times; the
6
+ * devices, sockets and pipes are skipped. Both fields are required.
7
+ * @example
8
+ * ```typescript
9
+ * import {createWriteStream} from 'node:fs'
10
+ * import {Containerd} from 'lakutata/com/containerd'
11
+ *
12
+ * declare const containerd: Containerd
13
+ *
14
+ * const container = await containerd.getContainer('web')
15
+ * //Into a file
16
+ * await container.exportDirectory({path: '/etc/nginx', destination: '/tmp/nginx-config.tar'})
17
+ * //Into a stream
18
+ * await container.exportDirectory({path: '/var/log/nginx', destination: createWriteStream('/tmp/nginx-logs.tar')})
19
+ * ```
20
+ */
21
+ export declare class ContainerExportDirectoryOptions extends DTO {
22
+ /**
23
+ * The absolute path in the container of the directory or file archived, its symbolic links resolved in the
24
+ * container; it is the archive's top entry, named by its base name. A missing path fails the export.
25
+ */
26
+ path: string;
27
+ /**
28
+ * Where the tar archive is written: the path of a host file (created or replaced), or a writable stream, ended
29
+ * once the archive is written.
30
+ */
31
+ destination: string | NodeJS.WritableStream;
32
+ }