@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.
- package/LICENSE +23 -0
- package/README.md +409 -2
- package/THIRD_PARTY_NOTICES.md +310 -0
- package/dist/cjs/client/BuildKit.d.ts +176 -0
- package/dist/cjs/client/BuildKit.js +536 -0
- package/dist/cjs/client/BuildKitMessages.d.ts +35 -0
- package/dist/cjs/client/BuildKitMessages.js +123 -0
- package/dist/cjs/client/ContainerStore.d.ts +558 -0
- package/dist/cjs/client/ContainerStore.js +1384 -0
- package/dist/cjs/client/ContainerdClient.d.ts +244 -0
- package/dist/cjs/client/ContainerdClient.js +455 -0
- package/dist/cjs/client/DockerIgnore.d.ts +44 -0
- package/dist/cjs/client/DockerIgnore.js +186 -0
- package/dist/cjs/client/Fifo.d.ts +31 -0
- package/dist/cjs/client/Fifo.js +66 -0
- package/dist/cjs/client/ImageStore.d.ts +258 -0
- package/dist/cjs/client/ImageStore.js +636 -0
- package/dist/cjs/client/Messages.d.ts +103 -0
- package/dist/cjs/client/Messages.js +397 -0
- package/dist/cjs/client/Networks.d.ts +221 -0
- package/dist/cjs/client/Networks.js +630 -0
- package/dist/cjs/client/Platforms.d.ts +53 -0
- package/dist/cjs/client/Platforms.js +169 -0
- package/dist/cjs/client/Reference.d.ts +33 -0
- package/dist/cjs/client/Reference.js +70 -0
- package/dist/cjs/client/Registry.d.ts +145 -0
- package/dist/cjs/client/Registry.js +272 -0
- package/dist/cjs/client/Rootfs.d.ts +83 -0
- package/dist/cjs/client/Rootfs.js +245 -0
- package/dist/cjs/client/Seccomp.d.ts +36 -0
- package/dist/cjs/client/Seccomp.js +156 -0
- package/dist/cjs/client/Spec.d.ts +151 -0
- package/dist/cjs/client/Spec.js +227 -0
- package/dist/cjs/client/Volumes.d.ts +42 -0
- package/dist/cjs/client/Volumes.js +80 -0
- package/dist/cjs/containerd/Containerd.d.ts +442 -0
- package/dist/cjs/containerd/Containerd.js +929 -0
- package/dist/cjs/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdConnectionException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.js +15 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
- package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.js +17 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageExportException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageImportException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdImagePullException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
- package/dist/cjs/containerd/exceptions/ContainerdImagePushException.js +15 -0
- package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
- package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.js +15 -0
- package/dist/cjs/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
- package/dist/cjs/containerd/exceptions/ContainerdPlatformException.js +16 -0
- package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
- package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.js +15 -0
- package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
- package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.js +15 -0
- package/dist/cjs/containerd/lib/ContainerdContainer.d.ts +292 -0
- package/dist/cjs/containerd/lib/ContainerdContainer.js +536 -0
- package/dist/cjs/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
- package/dist/cjs/containerd/lib/ContainerdContainerTTY.js +178 -0
- package/dist/cjs/containerd/lib/ContainerdErrors.d.ts +6 -0
- package/dist/cjs/containerd/lib/ContainerdErrors.js +37 -0
- package/dist/cjs/containerd/lib/ContainerdImage.d.ts +149 -0
- package/dist/cjs/containerd/lib/ContainerdImage.js +222 -0
- package/dist/cjs/containerd/options/ContainerdPruneOptions.d.ts +44 -0
- package/dist/cjs/containerd/options/ContainerdPruneOptions.js +51 -0
- package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
- package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.js +45 -0
- package/dist/cjs/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
- package/dist/cjs/containerd/options/container/ContainerCommitOptions.js +66 -0
- package/dist/cjs/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
- package/dist/cjs/containerd/options/container/ContainerCreateOptions.js +239 -0
- package/dist/cjs/containerd/options/container/ContainerExecOptions.d.ts +53 -0
- package/dist/cjs/containerd/options/container/ContainerExecOptions.js +63 -0
- package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
- package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.js +45 -0
- package/dist/cjs/containerd/options/container/ContainerKillOptions.d.ts +30 -0
- package/dist/cjs/containerd/options/container/ContainerKillOptions.js +41 -0
- package/dist/cjs/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
- package/dist/cjs/containerd/options/container/ContainerLogsOptions.js +44 -0
- package/dist/cjs/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
- package/dist/cjs/containerd/options/container/ContainerRemoveOptions.js +34 -0
- package/dist/cjs/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
- package/dist/cjs/containerd/options/container/ContainerResourceOptions.js +67 -0
- package/dist/cjs/containerd/options/container/ContainerStopOptions.d.ts +30 -0
- package/dist/cjs/containerd/options/container/ContainerStopOptions.js +41 -0
- package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
- package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.js +40 -0
- package/dist/cjs/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
- package/dist/cjs/containerd/options/container/ContainerTTYOptions.js +63 -0
- package/dist/cjs/containerd/options/image/ImageBuildOptions.d.ts +88 -0
- package/dist/cjs/containerd/options/image/ImageBuildOptions.js +95 -0
- package/dist/cjs/containerd/options/image/ImageExportOptions.d.ts +25 -0
- package/dist/cjs/containerd/options/image/ImageExportOptions.js +39 -0
- package/dist/cjs/containerd/options/image/ImageImportOptions.d.ts +38 -0
- package/dist/cjs/containerd/options/image/ImageImportOptions.js +47 -0
- package/dist/cjs/containerd/options/image/ImagePullOptions.d.ts +53 -0
- package/dist/cjs/containerd/options/image/ImagePullOptions.js +66 -0
- package/dist/cjs/containerd/options/image/ImagePushOptions.d.ts +44 -0
- package/dist/cjs/containerd/options/image/ImagePushOptions.js +58 -0
- package/dist/cjs/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
- package/dist/cjs/containerd/options/network/NetworkCreateOptions.js +83 -0
- package/dist/cjs/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
- package/dist/cjs/containerd/options/volume/VolumeCreateOptions.js +40 -0
- package/dist/cjs/containerd/types/ContainerdBind.d.ts +28 -0
- package/dist/cjs/containerd/types/ContainerdBind.js +2 -0
- package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
- package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.js +2 -0
- package/dist/cjs/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
- package/dist/cjs/containerd/types/ContainerdContainerNetwork.js +2 -0
- package/dist/cjs/containerd/types/ContainerdContainerPort.d.ts +22 -0
- package/dist/cjs/containerd/types/ContainerdContainerPort.js +2 -0
- package/dist/cjs/containerd/types/ContainerdContainerState.d.ts +42 -0
- package/dist/cjs/containerd/types/ContainerdContainerState.js +2 -0
- package/dist/cjs/containerd/types/ContainerdContainerStats.d.ts +107 -0
- package/dist/cjs/containerd/types/ContainerdContainerStats.js +2 -0
- package/dist/cjs/containerd/types/ContainerdDevice.d.ts +25 -0
- package/dist/cjs/containerd/types/ContainerdDevice.js +2 -0
- package/dist/cjs/containerd/types/ContainerdExecResult.d.ts +18 -0
- package/dist/cjs/containerd/types/ContainerdExecResult.js +2 -0
- package/dist/cjs/containerd/types/ContainerdImageConfig.d.ts +46 -0
- package/dist/cjs/containerd/types/ContainerdImageConfig.js +2 -0
- package/dist/cjs/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
- package/dist/cjs/containerd/types/ContainerdNetworkInfo.js +2 -0
- package/dist/cjs/containerd/types/ContainerdProgressCallback.d.ts +29 -0
- package/dist/cjs/containerd/types/ContainerdProgressCallback.js +2 -0
- package/dist/cjs/containerd/types/ContainerdPruneResult.d.ts +21 -0
- package/dist/cjs/containerd/types/ContainerdPruneResult.js +2 -0
- package/dist/cjs/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
- package/dist/cjs/containerd/types/ContainerdRestartPolicy.js +2 -0
- package/dist/cjs/containerd/types/ContainerdTmpfs.d.ts +20 -0
- package/dist/cjs/containerd/types/ContainerdTmpfs.js +2 -0
- package/dist/cjs/containerd/types/ContainerdVolume.d.ts +19 -0
- package/dist/cjs/containerd/types/ContainerdVolume.js +2 -0
- package/dist/cjs/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
- package/dist/cjs/containerd/types/ContainerdVolumeInfo.js +2 -0
- package/dist/cjs/exports/Containerd.d.ts +69 -0
- package/dist/cjs/exports/Containerd.js +87 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/client/BuildKit.js +488 -0
- package/dist/esm/client/BuildKitMessages.js +120 -0
- package/dist/esm/client/ContainerStore.js +1339 -0
- package/dist/esm/client/ContainerdClient.js +416 -0
- package/dist/esm/client/DockerIgnore.js +179 -0
- package/dist/esm/client/Fifo.js +59 -0
- package/dist/esm/client/ImageStore.js +628 -0
- package/dist/esm/client/Messages.js +393 -0
- package/dist/esm/client/Networks.js +621 -0
- package/dist/esm/client/Platforms.js +156 -0
- package/dist/esm/client/Reference.js +66 -0
- package/dist/esm/client/Registry.js +263 -0
- package/dist/esm/client/Rootfs.js +234 -0
- package/dist/esm/client/Seccomp.js +152 -0
- package/dist/esm/client/Spec.js +220 -0
- package/dist/esm/client/Volumes.js +73 -0
- package/dist/esm/containerd/Containerd.js +923 -0
- package/dist/esm/containerd/exceptions/ContainerdConnectionException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdContainerNameConflictException.js +11 -0
- package/dist/esm/containerd/exceptions/ContainerdContainerNotFoundException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdContainerStateException.js +13 -0
- package/dist/esm/containerd/exceptions/ContainerdImageBuildException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdImageExportException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdImageImportException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdImageNotFoundException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdImagePullException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdImagePushException.js +11 -0
- package/dist/esm/containerd/exceptions/ContainerdNetworkConflictException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdNetworkNotFoundException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdPathNotFoundException.js +11 -0
- package/dist/esm/containerd/exceptions/ContainerdPlatformException.js +12 -0
- package/dist/esm/containerd/exceptions/ContainerdVolumeInUseException.js +11 -0
- package/dist/esm/containerd/exceptions/ContainerdVolumeNotFoundException.js +11 -0
- package/dist/esm/containerd/lib/ContainerdContainer.js +533 -0
- package/dist/esm/containerd/lib/ContainerdContainerTTY.js +175 -0
- package/dist/esm/containerd/lib/ContainerdErrors.js +34 -0
- package/dist/esm/containerd/lib/ContainerdImage.js +219 -0
- package/dist/esm/containerd/options/ContainerdPruneOptions.js +47 -0
- package/dist/esm/containerd/options/ContainerdRegistryAuthOptions.js +41 -0
- package/dist/esm/containerd/options/container/ContainerCommitOptions.js +62 -0
- package/dist/esm/containerd/options/container/ContainerCreateOptions.js +235 -0
- package/dist/esm/containerd/options/container/ContainerExecOptions.js +59 -0
- package/dist/esm/containerd/options/container/ContainerExportDirectoryOptions.js +41 -0
- package/dist/esm/containerd/options/container/ContainerKillOptions.js +37 -0
- package/dist/esm/containerd/options/container/ContainerLogsOptions.js +40 -0
- package/dist/esm/containerd/options/container/ContainerRemoveOptions.js +30 -0
- package/dist/esm/containerd/options/container/ContainerResourceOptions.js +63 -0
- package/dist/esm/containerd/options/container/ContainerStopOptions.js +37 -0
- package/dist/esm/containerd/options/container/ContainerTTYConsoleSizeOptions.js +36 -0
- package/dist/esm/containerd/options/container/ContainerTTYOptions.js +59 -0
- package/dist/esm/containerd/options/image/ImageBuildOptions.js +91 -0
- package/dist/esm/containerd/options/image/ImageExportOptions.js +35 -0
- package/dist/esm/containerd/options/image/ImageImportOptions.js +43 -0
- package/dist/esm/containerd/options/image/ImagePullOptions.js +62 -0
- package/dist/esm/containerd/options/image/ImagePushOptions.js +54 -0
- package/dist/esm/containerd/options/network/NetworkCreateOptions.js +79 -0
- package/dist/esm/containerd/options/volume/VolumeCreateOptions.js +36 -0
- package/dist/esm/containerd/types/ContainerdBind.js +1 -0
- package/dist/esm/containerd/types/ContainerdBuildOutputCallback.js +1 -0
- package/dist/esm/containerd/types/ContainerdContainerNetwork.js +1 -0
- package/dist/esm/containerd/types/ContainerdContainerPort.js +1 -0
- package/dist/esm/containerd/types/ContainerdContainerState.js +1 -0
- package/dist/esm/containerd/types/ContainerdContainerStats.js +1 -0
- package/dist/esm/containerd/types/ContainerdDevice.js +1 -0
- package/dist/esm/containerd/types/ContainerdExecResult.js +1 -0
- package/dist/esm/containerd/types/ContainerdImageConfig.js +1 -0
- package/dist/esm/containerd/types/ContainerdNetworkInfo.js +1 -0
- package/dist/esm/containerd/types/ContainerdProgressCallback.js +1 -0
- package/dist/esm/containerd/types/ContainerdPruneResult.js +1 -0
- package/dist/esm/containerd/types/ContainerdRestartPolicy.js +1 -0
- package/dist/esm/containerd/types/ContainerdTmpfs.js +1 -0
- package/dist/esm/containerd/types/ContainerdVolume.js +1 -0
- package/dist/esm/containerd/types/ContainerdVolumeInfo.js +1 -0
- package/dist/esm/exports/Containerd.js +68 -0
- package/dist/types/client/BuildKit.d.ts +176 -0
- package/dist/types/client/BuildKitMessages.d.ts +35 -0
- package/dist/types/client/ContainerStore.d.ts +558 -0
- package/dist/types/client/ContainerdClient.d.ts +244 -0
- package/dist/types/client/DockerIgnore.d.ts +44 -0
- package/dist/types/client/Fifo.d.ts +31 -0
- package/dist/types/client/ImageStore.d.ts +258 -0
- package/dist/types/client/Messages.d.ts +103 -0
- package/dist/types/client/Networks.d.ts +221 -0
- package/dist/types/client/Platforms.d.ts +53 -0
- package/dist/types/client/Reference.d.ts +33 -0
- package/dist/types/client/Registry.d.ts +145 -0
- package/dist/types/client/Rootfs.d.ts +83 -0
- package/dist/types/client/Seccomp.d.ts +36 -0
- package/dist/types/client/Spec.d.ts +151 -0
- package/dist/types/client/Volumes.d.ts +42 -0
- package/dist/types/containerd/Containerd.d.ts +442 -0
- package/dist/types/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
- package/dist/types/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
- package/dist/types/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
- package/dist/types/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
- package/dist/types/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
- package/dist/types/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
- package/dist/types/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
- package/dist/types/containerd/lib/ContainerdContainer.d.ts +292 -0
- package/dist/types/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
- package/dist/types/containerd/lib/ContainerdErrors.d.ts +6 -0
- package/dist/types/containerd/lib/ContainerdImage.d.ts +149 -0
- package/dist/types/containerd/options/ContainerdPruneOptions.d.ts +44 -0
- package/dist/types/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
- package/dist/types/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
- package/dist/types/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
- package/dist/types/containerd/options/container/ContainerExecOptions.d.ts +53 -0
- package/dist/types/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
- package/dist/types/containerd/options/container/ContainerKillOptions.d.ts +30 -0
- package/dist/types/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
- package/dist/types/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
- package/dist/types/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
- package/dist/types/containerd/options/container/ContainerStopOptions.d.ts +30 -0
- package/dist/types/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
- package/dist/types/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
- package/dist/types/containerd/options/image/ImageBuildOptions.d.ts +88 -0
- package/dist/types/containerd/options/image/ImageExportOptions.d.ts +25 -0
- package/dist/types/containerd/options/image/ImageImportOptions.d.ts +38 -0
- package/dist/types/containerd/options/image/ImagePullOptions.d.ts +53 -0
- package/dist/types/containerd/options/image/ImagePushOptions.d.ts +44 -0
- package/dist/types/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
- package/dist/types/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
- package/dist/types/containerd/types/ContainerdBind.d.ts +28 -0
- package/dist/types/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
- package/dist/types/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
- package/dist/types/containerd/types/ContainerdContainerPort.d.ts +22 -0
- package/dist/types/containerd/types/ContainerdContainerState.d.ts +42 -0
- package/dist/types/containerd/types/ContainerdContainerStats.d.ts +107 -0
- package/dist/types/containerd/types/ContainerdDevice.d.ts +25 -0
- package/dist/types/containerd/types/ContainerdExecResult.d.ts +18 -0
- package/dist/types/containerd/types/ContainerdImageConfig.d.ts +46 -0
- package/dist/types/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
- package/dist/types/containerd/types/ContainerdProgressCallback.d.ts +29 -0
- package/dist/types/containerd/types/ContainerdPruneResult.d.ts +21 -0
- package/dist/types/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
- package/dist/types/containerd/types/ContainerdTmpfs.d.ts +20 -0
- package/dist/types/containerd/types/ContainerdVolume.d.ts +19 -0
- package/dist/types/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
- package/dist/types/exports/Containerd.d.ts +69 -0
- package/package.json +51 -4
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { SeccompProfile } from './Seccomp.js';
|
|
2
|
+
/**
|
|
3
|
+
* The capabilities of the containers by default (the ones of containerd, Docker and nerdctl)
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_CAPABILITIES: readonly string[];
|
|
6
|
+
/**
|
|
7
|
+
* All the capabilities of Linux (the privileged containers)
|
|
8
|
+
*/
|
|
9
|
+
export declare const ALL_CAPABILITIES: readonly string[];
|
|
10
|
+
/**
|
|
11
|
+
* A bind mount of a container
|
|
12
|
+
*/
|
|
13
|
+
export type SpecMount = {
|
|
14
|
+
type?: string;
|
|
15
|
+
source: string;
|
|
16
|
+
destination: string;
|
|
17
|
+
options?: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A device of the host given to a container
|
|
21
|
+
*/
|
|
22
|
+
export type SpecDevice = {
|
|
23
|
+
path: string;
|
|
24
|
+
containerPath: string;
|
|
25
|
+
type: 'c' | 'b';
|
|
26
|
+
major: number;
|
|
27
|
+
minor: number;
|
|
28
|
+
fileMode?: number;
|
|
29
|
+
uid?: number;
|
|
30
|
+
gid?: number;
|
|
31
|
+
permissions: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A rule of the devices of the cgroup of a container: the devices of a type (a: all), of a major and a minor number
|
|
35
|
+
* (all when they are not given), and their access (r, w, m)
|
|
36
|
+
*/
|
|
37
|
+
export type DeviceCgroupRule = {
|
|
38
|
+
type: 'a' | 'c' | 'b';
|
|
39
|
+
major?: number;
|
|
40
|
+
minor?: number;
|
|
41
|
+
access: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Parse a rule of the devices of a cgroup as Docker writes it: "c 188:* rwm", "b 8:16 r", "a *:* rwm"
|
|
45
|
+
* @param rule
|
|
46
|
+
*/
|
|
47
|
+
export declare function parseDeviceCgroupRule(rule: string): DeviceCgroupRule;
|
|
48
|
+
/**
|
|
49
|
+
* The options of the specification of a container
|
|
50
|
+
*/
|
|
51
|
+
export type SpecOptions = {
|
|
52
|
+
id: string;
|
|
53
|
+
namespace: string;
|
|
54
|
+
args: string[];
|
|
55
|
+
env: string[];
|
|
56
|
+
cwd: string;
|
|
57
|
+
uid: number;
|
|
58
|
+
gid: number;
|
|
59
|
+
additionalGids: number[];
|
|
60
|
+
hostname: string;
|
|
61
|
+
terminal?: boolean;
|
|
62
|
+
privileged?: boolean;
|
|
63
|
+
readonlyRootfs?: boolean;
|
|
64
|
+
capAdd?: string[];
|
|
65
|
+
capDrop?: string[];
|
|
66
|
+
mounts?: SpecMount[];
|
|
67
|
+
devices?: SpecDevice[];
|
|
68
|
+
/**
|
|
69
|
+
* The devices the cgroup allows besides the ones given (the ones plugged later, by a bind mount of /dev)
|
|
70
|
+
*/
|
|
71
|
+
deviceCgroupRules?: DeviceCgroupRule[];
|
|
72
|
+
/**
|
|
73
|
+
* The network: the one of the host, or a namespace of its own (only its loopback, or the path of the one prepared)
|
|
74
|
+
*/
|
|
75
|
+
network: {
|
|
76
|
+
mode: 'host';
|
|
77
|
+
} | {
|
|
78
|
+
mode: 'none';
|
|
79
|
+
} | {
|
|
80
|
+
mode: 'path';
|
|
81
|
+
path: string;
|
|
82
|
+
} | {
|
|
83
|
+
mode: 'cni';
|
|
84
|
+
};
|
|
85
|
+
pidHost?: boolean;
|
|
86
|
+
ipcHost?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* A cgroup namespace of its own (the private one of Docker and nerdctl on cgroup v2): its cgroup is the root of its
|
|
89
|
+
* /sys/fs/cgroup
|
|
90
|
+
*/
|
|
91
|
+
cgroupNamespace?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The path of the cgroup (/default/id with cgroupfs, system.slice:lakutata:id with systemd)
|
|
94
|
+
*/
|
|
95
|
+
cgroupsPath: string;
|
|
96
|
+
memory?: number;
|
|
97
|
+
memorySwap?: number;
|
|
98
|
+
cpuQuota?: number;
|
|
99
|
+
cpuPeriod?: number;
|
|
100
|
+
cpuShares?: number;
|
|
101
|
+
cpuset?: string;
|
|
102
|
+
pidsLimit?: number;
|
|
103
|
+
oomKillDisable?: boolean;
|
|
104
|
+
sysctls?: Record<string, string>;
|
|
105
|
+
shmSize?: number;
|
|
106
|
+
rlimits?: {
|
|
107
|
+
type: string;
|
|
108
|
+
hard: number;
|
|
109
|
+
soft: number;
|
|
110
|
+
}[];
|
|
111
|
+
annotations?: Record<string, string>;
|
|
112
|
+
/**
|
|
113
|
+
* The profile of seccomp of the processes (none: unconfined)
|
|
114
|
+
*/
|
|
115
|
+
seccomp?: SeccompProfile;
|
|
116
|
+
/**
|
|
117
|
+
* The hooks of the runtime (createRuntime, poststop…)
|
|
118
|
+
*/
|
|
119
|
+
hooks?: Record<string, {
|
|
120
|
+
path: string;
|
|
121
|
+
args?: string[];
|
|
122
|
+
env?: string[];
|
|
123
|
+
timeout?: number;
|
|
124
|
+
}[]>;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The capabilities of a container: the ones by default (all for the privileged containers), the ones added, without
|
|
128
|
+
* the ones dropped (ALL drops all)
|
|
129
|
+
* @param options
|
|
130
|
+
*/
|
|
131
|
+
export declare function containerCapabilities(options: Pick<SpecOptions, 'privileged' | 'capAdd' | 'capDrop'>): string[];
|
|
132
|
+
/**
|
|
133
|
+
* The specification of the runtime (OCI) of a container on Linux, as containerd and nerdctl generate it
|
|
134
|
+
* @param options
|
|
135
|
+
*/
|
|
136
|
+
export declare function generateSpec(options: SpecOptions): Record<string, any>;
|
|
137
|
+
/**
|
|
138
|
+
* The specification of a process executed in a container (exec): the one of the container, its arguments, its
|
|
139
|
+
* environment, its directory, its user and its terminal changed
|
|
140
|
+
* @param spec the specification of the container
|
|
141
|
+
* @param options
|
|
142
|
+
*/
|
|
143
|
+
export declare function execProcessSpec(spec: Record<string, any>, options: {
|
|
144
|
+
args: string[];
|
|
145
|
+
env?: string[];
|
|
146
|
+
cwd?: string;
|
|
147
|
+
uid?: number;
|
|
148
|
+
gid?: number;
|
|
149
|
+
additionalGids?: number[];
|
|
150
|
+
terminal?: boolean;
|
|
151
|
+
}): Record<string, any>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A named volume: a directory of the data root mounted in the containers
|
|
3
|
+
*/
|
|
4
|
+
export type Volume = {
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* Its directory of the host (mounted in the containers)
|
|
8
|
+
*/
|
|
9
|
+
mountpoint: string;
|
|
10
|
+
labels: Record<string, string>;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The named volumes of a namespace: <data root>/volumes/<namespace>/<name>/_data, their information in volume.json
|
|
15
|
+
*/
|
|
16
|
+
export declare class VolumeStore {
|
|
17
|
+
readonly directory: string;
|
|
18
|
+
constructor(directory: string);
|
|
19
|
+
/**
|
|
20
|
+
* Whether a name is the one of a volume
|
|
21
|
+
* @param name
|
|
22
|
+
*/
|
|
23
|
+
static ValidName(name: string): boolean;
|
|
24
|
+
protected path(name: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* A volume, undefined when it does not exist
|
|
27
|
+
* @param name
|
|
28
|
+
*/
|
|
29
|
+
get(name: string): Promise<Volume | undefined>;
|
|
30
|
+
list(): Promise<Volume[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Create a volume (the existing one is given when it exists, as Docker does)
|
|
33
|
+
* @param name
|
|
34
|
+
* @param labels
|
|
35
|
+
*/
|
|
36
|
+
create(name: string, labels?: Record<string, string>): Promise<Volume>;
|
|
37
|
+
/**
|
|
38
|
+
* Remove a volume and its data
|
|
39
|
+
* @param name
|
|
40
|
+
*/
|
|
41
|
+
remove(name: string): Promise<void>;
|
|
42
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exception } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when the {@link Containerd} component is created and containerd does not answer on its `socketPath`
|
|
4
|
+
* (containerd not running, no access to the socket: run as root or as a member of the socket's group), or its
|
|
5
|
+
* `buildkitTLS` is given with a unix socket `buildkitAddress`. Its `errno` is `E_CONTAINERD_CONNECTION`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ContainerdConnectionException extends Exception {
|
|
8
|
+
errno: string | number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exception } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a container is created (or created again by an update) with a name another container of the namespace
|
|
4
|
+
* has. Its `errno` is `E_CONTAINERD_CONTAINER_NAME_CONFLICT`.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ContainerdContainerNameConflictException extends Exception {
|
|
7
|
+
errno: string | number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exception } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when no container of the namespace has the identifier, name or identifier prefix asked
|
|
4
|
+
* ({@link Containerd.getContainer}), or when a container object is synced after its container was removed. Its `errno`
|
|
5
|
+
* is `E_CONTAINERD_CONTAINER_NOT_FOUND`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ContainerdContainerNotFoundException extends Exception {
|
|
8
|
+
errno: string | number;
|
|
9
|
+
}
|