@lakutata/containerd 0.0.0-stage → 3.0.0-beta.0
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,235 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* The settings of a container created by {@link Containerd.createContainer}: its image, its process, its mounts, its
|
|
14
|
+
* networks, its resources and its security. Only `image` is required; the container is created stopped (`start()` it)
|
|
15
|
+
* as a nerdctl container (`nerdctl ps` lists it), with an OCI runtime specification built as nerdctl builds it. The
|
|
16
|
+
* component keeps these settings: {@link ContainerdContainer.update} creates the container again with the ones it
|
|
17
|
+
* changes.
|
|
18
|
+
*
|
|
19
|
+
* As with the Docker component, the container joins the default network `bridge` unless `network` or `networks` is
|
|
20
|
+
* 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
|
|
21
|
+
* nerdctl's volumes).
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
25
|
+
*
|
|
26
|
+
* declare const containerd: Containerd
|
|
27
|
+
*
|
|
28
|
+
* await containerd.pullImage({image: 'nginx:1.27'})
|
|
29
|
+
* const container = await containerd.createContainer({
|
|
30
|
+
* image: 'nginx:1.27',
|
|
31
|
+
* name: 'web',
|
|
32
|
+
* env: {NGINX_PORT: '80'},
|
|
33
|
+
* binds: [{hostPath: '/srv/www', containerPath: '/usr/share/nginx/html', rw: false}],
|
|
34
|
+
* volumes: [{volumeName: 'web-cache', containerPath: '/var/cache/nginx'}],
|
|
35
|
+
* //The default nerdctl network, its port 80 published on the host port 8080
|
|
36
|
+
* networks: [{networkName: 'bridge'}],
|
|
37
|
+
* ports: [{port: 80, hostPorts: [8080]}],
|
|
38
|
+
* memoryLimit: 256 * 1024 * 1024,
|
|
39
|
+
* cpus: 0.5,
|
|
40
|
+
* restartPolicy: 'unless-stopped'
|
|
41
|
+
* })
|
|
42
|
+
* await container.start()
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export class ContainerCreateOptions extends DTO {
|
|
46
|
+
}
|
|
47
|
+
__decorate([
|
|
48
|
+
Expect(DTO.String().required()),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ContainerCreateOptions.prototype, "image", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
Expect(DTO.String().optional()),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ContainerCreateOptions.prototype, "platform", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
Expect(DTO.String().pattern(/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/).optional()),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], ContainerCreateOptions.prototype, "name", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
Expect(DTO.String().optional()),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ContainerCreateOptions.prototype, "hostname", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
Expect(DTO.Array(DTO.String()).optional()),
|
|
65
|
+
__metadata("design:type", Array)
|
|
66
|
+
], ContainerCreateOptions.prototype, "cmd", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
Expect(DTO.Array(DTO.String()).optional()),
|
|
69
|
+
__metadata("design:type", Array)
|
|
70
|
+
], ContainerCreateOptions.prototype, "entrypoint", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String().allow('')).optional()),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], ContainerCreateOptions.prototype, "env", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
Expect(DTO.String().optional()),
|
|
77
|
+
__metadata("design:type", String)
|
|
78
|
+
], ContainerCreateOptions.prototype, "workingDir", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
Expect(DTO.String().optional()),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], ContainerCreateOptions.prototype, "user", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String().allow('')).optional()),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], ContainerCreateOptions.prototype, "labels", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
Expect(DTO.Boolean().optional()),
|
|
89
|
+
__metadata("design:type", Boolean)
|
|
90
|
+
], ContainerCreateOptions.prototype, "privileged", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
Expect(DTO.Boolean().optional()),
|
|
93
|
+
__metadata("design:type", Boolean)
|
|
94
|
+
], ContainerCreateOptions.prototype, "readonlyRootfs", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
Expect(DTO.Array(DTO.String()).optional()),
|
|
97
|
+
__metadata("design:type", Array)
|
|
98
|
+
], ContainerCreateOptions.prototype, "capabilities", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
Expect(DTO.Array(DTO.String()).optional()),
|
|
101
|
+
__metadata("design:type", Array)
|
|
102
|
+
], ContainerCreateOptions.prototype, "capabilitiesDrop", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
Expect(DTO.String().optional().default('default')),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], ContainerCreateOptions.prototype, "seccompProfile", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
Expect(DTO.Array(DTO.Object({
|
|
109
|
+
hostPath: DTO.String().required(),
|
|
110
|
+
containerPath: DTO.String().required(),
|
|
111
|
+
rw: DTO.Boolean().optional().default(true),
|
|
112
|
+
propagation: DTO.String().valid('private', 'rprivate', 'shared', 'rshared', 'slave', 'rslave').optional()
|
|
113
|
+
})).optional()),
|
|
114
|
+
__metadata("design:type", Array)
|
|
115
|
+
], ContainerCreateOptions.prototype, "binds", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
Expect(DTO.Array(DTO.Object({
|
|
118
|
+
volumeName: DTO.String().pattern(/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/).required(),
|
|
119
|
+
containerPath: DTO.String().required(),
|
|
120
|
+
readonly: DTO.Boolean().optional()
|
|
121
|
+
})).optional()),
|
|
122
|
+
__metadata("design:type", Array)
|
|
123
|
+
], ContainerCreateOptions.prototype, "volumes", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
Expect(DTO.Array(DTO.Object({
|
|
126
|
+
containerPath: DTO.String().required(),
|
|
127
|
+
size: DTO.Number().integer().positive().optional(),
|
|
128
|
+
mode: DTO.String().pattern(/^[0-7]{3,4}$/).optional()
|
|
129
|
+
})).optional()),
|
|
130
|
+
__metadata("design:type", Array)
|
|
131
|
+
], ContainerCreateOptions.prototype, "tmpfs", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
Expect(DTO.Array(DTO.Object({
|
|
134
|
+
hostPath: DTO.String().required(),
|
|
135
|
+
containerPath: DTO.String().optional(),
|
|
136
|
+
cgroupPermissions: DTO.String().pattern(/^(?!.*(.).*\1)[rwm]{1,3}$/).optional().default('rwm')
|
|
137
|
+
})).optional()),
|
|
138
|
+
__metadata("design:type", Array)
|
|
139
|
+
], ContainerCreateOptions.prototype, "devices", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
Expect(DTO.Array(DTO.String().pattern(/^[acb] (\*|\d+):(\*|\d+) (?!.*(.).*\3)[rwm]{1,3}$/)).optional()),
|
|
142
|
+
__metadata("design:type", Array)
|
|
143
|
+
], ContainerCreateOptions.prototype, "deviceCgroupRules", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
Expect(DTO.String().valid('host', 'none').optional()),
|
|
146
|
+
__metadata("design:type", String)
|
|
147
|
+
], ContainerCreateOptions.prototype, "network", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
Expect(DTO.Array(DTO.Object({
|
|
150
|
+
networkName: DTO.String().required(),
|
|
151
|
+
ip: DTO.String().allow('').ip({ version: 'ipv4' }).optional(),
|
|
152
|
+
ipv6: DTO.String().allow('').ip({ version: 'ipv6' }).optional()
|
|
153
|
+
})).optional()),
|
|
154
|
+
__metadata("design:type", Array)
|
|
155
|
+
], ContainerCreateOptions.prototype, "networks", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
Expect(DTO.Array(DTO.Object({
|
|
158
|
+
port: DTO.Number().port().required(),
|
|
159
|
+
type: DTO.String().valid('tcp', 'udp', 'sctp').optional().default('tcp'),
|
|
160
|
+
hostPorts: DTO.Array(DTO.Number().port()).min(1).required(),
|
|
161
|
+
hostIP: DTO.String().ip().optional()
|
|
162
|
+
})).optional()),
|
|
163
|
+
__metadata("design:type", Array)
|
|
164
|
+
], ContainerCreateOptions.prototype, "ports", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
Expect(DTO.String().valid('host').optional()),
|
|
167
|
+
__metadata("design:type", String)
|
|
168
|
+
], ContainerCreateOptions.prototype, "pidMode", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
Expect(DTO.String().valid('host').optional()),
|
|
171
|
+
__metadata("design:type", String)
|
|
172
|
+
], ContainerCreateOptions.prototype, "ipcMode", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
Expect(DTO.String().valid('private', 'host').optional().default('private')),
|
|
175
|
+
__metadata("design:type", String)
|
|
176
|
+
], ContainerCreateOptions.prototype, "cgroupns", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
Expect(DTO.Number().integer().min(0).optional()),
|
|
179
|
+
__metadata("design:type", Number)
|
|
180
|
+
], ContainerCreateOptions.prototype, "memoryLimit", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
Expect(DTO.Number().integer().min(-1).optional().custom((value, helpers) => {
|
|
183
|
+
const memoryLimit = helpers.state.ancestors?.[0]?.memoryLimit;
|
|
184
|
+
if (value > 0 && !memoryLimit)
|
|
185
|
+
return helpers.message({ custom: '"memorySwap" needs "memoryLimit"' });
|
|
186
|
+
if (value > 0 && value < memoryLimit)
|
|
187
|
+
return helpers.message({ custom: '"memorySwap" (the memory and the swap) must be at least "memoryLimit"' });
|
|
188
|
+
return value;
|
|
189
|
+
}, 'Swap Limit Validation')),
|
|
190
|
+
__metadata("design:type", Number)
|
|
191
|
+
], ContainerCreateOptions.prototype, "memorySwap", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
Expect(DTO.Number().positive().optional()),
|
|
194
|
+
__metadata("design:type", Number)
|
|
195
|
+
], ContainerCreateOptions.prototype, "cpus", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
Expect(DTO.Number().integer().positive().optional()),
|
|
198
|
+
__metadata("design:type", Number)
|
|
199
|
+
], ContainerCreateOptions.prototype, "cpuShares", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
Expect(DTO.Array(DTO.Number().integer().min(0)).optional()),
|
|
202
|
+
__metadata("design:type", Array)
|
|
203
|
+
], ContainerCreateOptions.prototype, "cpuSet", void 0);
|
|
204
|
+
__decorate([
|
|
205
|
+
Expect(DTO.Number().integer().positive().optional()),
|
|
206
|
+
__metadata("design:type", Number)
|
|
207
|
+
], ContainerCreateOptions.prototype, "pidsLimit", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
Expect(DTO.Boolean().optional()),
|
|
210
|
+
__metadata("design:type", Boolean)
|
|
211
|
+
], ContainerCreateOptions.prototype, "OOMKillDisable", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String()).optional()),
|
|
214
|
+
__metadata("design:type", Object)
|
|
215
|
+
], ContainerCreateOptions.prototype, "sysctls", void 0);
|
|
216
|
+
__decorate([
|
|
217
|
+
Expect(DTO.Number().integer().positive().optional()),
|
|
218
|
+
__metadata("design:type", Number)
|
|
219
|
+
], ContainerCreateOptions.prototype, "shmSize", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
Expect(DTO.String().allow('').pattern(/^(no|always|unless-stopped|on-failure(:\d+)?)$/).optional()),
|
|
222
|
+
__metadata("design:type", String)
|
|
223
|
+
], ContainerCreateOptions.prototype, "restartPolicy", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
Expect(DTO.String().optional()),
|
|
226
|
+
__metadata("design:type", String)
|
|
227
|
+
], ContainerCreateOptions.prototype, "stopSignal", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String().ip()).optional()),
|
|
230
|
+
__metadata("design:type", Object)
|
|
231
|
+
], ContainerCreateOptions.prototype, "extraHosts", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
Expect(DTO.Array(DTO.String().ip()).optional()),
|
|
234
|
+
__metadata("design:type", Array)
|
|
235
|
+
], ContainerCreateOptions.prototype, "dns", void 0);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* A command {@link ContainerdContainer.exec} runs in a running container (else it throws
|
|
14
|
+
* {@link ContainerdContainerStateException}), waiting for its exit and capturing its output in memory. Only `cmd` is
|
|
15
|
+
* required; the process gets the container's settings (environment, user, capabilities) unless changed here.
|
|
16
|
+
* Separating its standard error and giving it a standard input use FIFOs (`mkfifo` on the host). Unlike the Docker
|
|
17
|
+
* component's options, a string `cmd` is run by a shell, the process can get an environment, a user, a standard input
|
|
18
|
+
* and a timeout, and the result holds the exit code and the two outputs apart.
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
22
|
+
*
|
|
23
|
+
* declare const containerd: Containerd
|
|
24
|
+
*
|
|
25
|
+
* const container = await containerd.getContainer('db')
|
|
26
|
+
* const result = await container.exec({
|
|
27
|
+
* cmd: ['psql', '-U', 'postgres', '-f', '-'],
|
|
28
|
+
* stdin: 'SELECT 1;',
|
|
29
|
+
* timeout: 30000
|
|
30
|
+
* })
|
|
31
|
+
* if (result.exitCode !== 0) console.error(result.stderr)
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export class ContainerExecOptions extends DTO {
|
|
35
|
+
}
|
|
36
|
+
__decorate([
|
|
37
|
+
Expect(DTO.Alternatives(DTO.String(), DTO.Array(DTO.String()).min(1)).required()),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], ContainerExecOptions.prototype, "cmd", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String().allow('')).optional()),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], ContainerExecOptions.prototype, "env", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Expect(DTO.String().optional()),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ContainerExecOptions.prototype, "workingDir", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Expect(DTO.String().optional()),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], ContainerExecOptions.prototype, "user", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Expect(DTO.Alternatives(DTO.String().allow(''), DTO.Binary()).optional()),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], ContainerExecOptions.prototype, "stdin", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Expect(DTO.Number().integer().positive().optional()),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], ContainerExecOptions.prototype, "timeout", void 0);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
import { Stream } from 'node:stream';
|
|
13
|
+
/**
|
|
14
|
+
* What {@link ContainerdContainer.exportDirectory} archives (as tar) and where. A running container is read through
|
|
15
|
+
* its process root (its mounts included), a stopped one from its snapshot (its image layers and its changes, without
|
|
16
|
+
* its mounts). The directories, regular files and symbolic links are archived with their modes, owners and times; the
|
|
17
|
+
* devices, sockets and pipes are skipped. Both fields are required.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import {createWriteStream} from 'node:fs'
|
|
21
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
22
|
+
*
|
|
23
|
+
* declare const containerd: Containerd
|
|
24
|
+
*
|
|
25
|
+
* const container = await containerd.getContainer('web')
|
|
26
|
+
* //Into a file
|
|
27
|
+
* await container.exportDirectory({path: '/etc/nginx', destination: '/tmp/nginx-config.tar'})
|
|
28
|
+
* //Into a stream
|
|
29
|
+
* await container.exportDirectory({path: '/var/log/nginx', destination: createWriteStream('/tmp/nginx-logs.tar')})
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export class ContainerExportDirectoryOptions extends DTO {
|
|
33
|
+
}
|
|
34
|
+
__decorate([
|
|
35
|
+
Expect(DTO.String().required()),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ContainerExportDirectoryOptions.prototype, "path", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Expect(DTO.Alternatives(DTO.String(), DTO.InstanceOf(Stream)).required()),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], ContainerExportDirectoryOptions.prototype, "destination", void 0);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* The signal {@link ContainerdContainer.kill} sends to a running container, without waiting for it to exit. Every
|
|
14
|
+
* field is optional. A `SIGKILL` also tells containerd's restart monitor not to restart the container; the other
|
|
15
|
+
* signals do not. Unlike the Docker component's options, the signal may be a number, and all the processes can be
|
|
16
|
+
* signaled.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
20
|
+
*
|
|
21
|
+
* declare const containerd: Containerd
|
|
22
|
+
*
|
|
23
|
+
* const container = await containerd.getContainer('web')
|
|
24
|
+
* //Reload nginx's configuration
|
|
25
|
+
* await container.kill({signal: 'SIGHUP'})
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class ContainerKillOptions extends DTO {
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
Expect(DTO.Alternatives(DTO.String(), DTO.Number().integer().positive()).optional().default('SIGKILL')),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], ContainerKillOptions.prototype, "signal", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
Expect(DTO.Boolean().optional().default(false)),
|
|
36
|
+
__metadata("design:type", Boolean)
|
|
37
|
+
], ContainerKillOptions.prototype, "all", void 0);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* How {@link ContainerdContainer.logs} reads a container's logs: the file its containerd shim writes its standard
|
|
14
|
+
* output and error to, interleaved and raw (no timestamps, no stream prefix), with its previous rotated file (the
|
|
15
|
+
* component's `logMaxSize` option). Every field is optional. Unlike the Docker component's options, there is no
|
|
16
|
+
* `since`, `until` nor `timestamps`.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
20
|
+
*
|
|
21
|
+
* declare const containerd: Containerd
|
|
22
|
+
*
|
|
23
|
+
* const container = await containerd.getContainer('web')
|
|
24
|
+
* //The last 100 lines, then the new ones while it runs
|
|
25
|
+
* const logs = await container.logs({tail: 100})
|
|
26
|
+
* logs.on('data', (chunk: Buffer): void => {
|
|
27
|
+
* process.stdout.write(chunk)
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export class ContainerLogsOptions extends DTO {
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
Expect(DTO.Boolean().optional().default(true)),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], ContainerLogsOptions.prototype, "follow", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
Expect(DTO.Number().integer().min(0).optional()),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], ContainerLogsOptions.prototype, "tail", void 0);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* How {@link ContainerdContainer.remove} removes a container, with its snapshot, its network interfaces and its state
|
|
14
|
+
* directory (its logs); its named volumes are kept. The field is optional.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
18
|
+
*
|
|
19
|
+
* declare const containerd: Containerd
|
|
20
|
+
*
|
|
21
|
+
* const container = await containerd.getContainer('web')
|
|
22
|
+
* await container.remove({force: true})
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export class ContainerRemoveOptions extends DTO {
|
|
26
|
+
}
|
|
27
|
+
__decorate([
|
|
28
|
+
Expect(DTO.Boolean().optional().default(false)),
|
|
29
|
+
__metadata("design:type", Boolean)
|
|
30
|
+
], ContainerRemoveOptions.prototype, "force", void 0);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* The settings {@link ContainerdContainer.update} changes without creating the container again (as `docker update`
|
|
14
|
+
* does): its resource limits and its restart policy. An update giving only these fields is validated by this class and
|
|
15
|
+
* applied to the container's runtime specification and, while it runs, to its cgroup; the fields not given keep their
|
|
16
|
+
* values. A limit set to `0` (`[]` for `cpuSet`) is removed at once, from the running container too, and from the
|
|
17
|
+
* settings the container is created again with. Every field is optional. An update with any other field of
|
|
18
|
+
* {@link ContainerCreateOptions} creates the container again instead.
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
22
|
+
*
|
|
23
|
+
* declare const containerd: Containerd
|
|
24
|
+
*
|
|
25
|
+
* const container = await containerd.getContainer('web')
|
|
26
|
+
* //Applied to the running container
|
|
27
|
+
* await container.update({memoryLimit: 512 * 1024 * 1024, cpus: 2, restartPolicy: 'on-failure:3'})
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export class ContainerResourceOptions extends DTO {
|
|
31
|
+
}
|
|
32
|
+
__decorate([
|
|
33
|
+
Expect(DTO.Number().integer().min(0).optional()),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], ContainerResourceOptions.prototype, "memoryLimit", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Expect(DTO.Number().integer().min(-1).optional()),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], ContainerResourceOptions.prototype, "memorySwap", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Expect(DTO.Number().min(0).optional()),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], ContainerResourceOptions.prototype, "cpus", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Expect(DTO.Number().integer().min(0).optional()),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], ContainerResourceOptions.prototype, "cpuShares", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Expect(DTO.Array(DTO.Number().integer().min(0)).optional()),
|
|
50
|
+
__metadata("design:type", Array)
|
|
51
|
+
], ContainerResourceOptions.prototype, "cpuSet", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Expect(DTO.Number().integer().min(0).optional()),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], ContainerResourceOptions.prototype, "pidsLimit", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Expect(DTO.Boolean().optional()),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], ContainerResourceOptions.prototype, "OOMKillDisable", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Expect(DTO.String().allow('').pattern(/^(no|always|unless-stopped|on-failure(:\d+)?)$/).optional()),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ContainerResourceOptions.prototype, "restartPolicy", void 0);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* How {@link ContainerdContainer.stop} (and `restart()`) stops a container: its stop signal sent to its main process
|
|
14
|
+
* (a paused container is resumed first), then, after the timeout, `SIGKILL` sent to all its processes; its task is
|
|
15
|
+
* deleted (its exit code kept) and containerd's restart monitor told not to restart it. Every field is optional.
|
|
16
|
+
* Unlike the Docker component's options, the signal may be a number.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
20
|
+
*
|
|
21
|
+
* declare const containerd: Containerd
|
|
22
|
+
*
|
|
23
|
+
* const container = await containerd.getContainer('db')
|
|
24
|
+
* //A minute to shut down cleanly
|
|
25
|
+
* await container.stop({signal: 'SIGINT', timeout: 60})
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export class ContainerStopOptions extends DTO {
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
Expect(DTO.Number().integer().min(0).optional().default(10)),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], ContainerStopOptions.prototype, "timeout", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
Expect(DTO.Alternatives(DTO.String(), DTO.Number().integer().positive()).optional()),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], ContainerStopOptions.prototype, "signal", void 0);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
/**
|
|
13
|
+
* The size of a container terminal, in characters: the initial one ({@link ContainerTTYOptions.consoleSize}), or the
|
|
14
|
+
* new one given to {@link ContainerdContainerTTY.resize}. Both fields are required.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
18
|
+
*
|
|
19
|
+
* declare const containerd: Containerd
|
|
20
|
+
*
|
|
21
|
+
* const container = await containerd.getContainer('web')
|
|
22
|
+
* const tty = await container.createTTY({consoleSize: {cols: 80, rows: 24}})
|
|
23
|
+
* //The user's window was resized
|
|
24
|
+
* await tty.resize({cols: 120, rows: 40})
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export class ContainerTTYConsoleSizeOptions extends DTO {
|
|
28
|
+
}
|
|
29
|
+
__decorate([
|
|
30
|
+
Expect(DTO.Number().integer().positive().required()),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], ContainerTTYConsoleSizeOptions.prototype, "cols", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Expect(DTO.Number().integer().positive().required()),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], ContainerTTYConsoleSizeOptions.prototype, "rows", void 0);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { DTO } from '@lakutata/core';
|
|
11
|
+
import { Expect } from '@lakutata/core/decorator/dto';
|
|
12
|
+
import { ContainerTTYConsoleSizeOptions } from './ContainerTTYConsoleSizeOptions.js';
|
|
13
|
+
/**
|
|
14
|
+
* The process {@link ContainerdContainer.createTTY} runs with a pseudo terminal in a running container (else it throws
|
|
15
|
+
* {@link ContainerdContainerStateException}); the terminal needs `mkfifo` on the host. Every field is optional.
|
|
16
|
+
* Unlike the Docker component's options, the environment, the working directory and the user can be set.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
20
|
+
*
|
|
21
|
+
* declare const containerd: Containerd
|
|
22
|
+
*
|
|
23
|
+
* const container = await containerd.getContainer('web')
|
|
24
|
+
* const tty = await container.createTTY({cmd: ['/bin/bash', '-l'], consoleSize: {cols: 120, rows: 40}, user: 'www-data'})
|
|
25
|
+
* tty.onData((chunk: Buffer): void => {
|
|
26
|
+
* process.stdout.write(chunk)
|
|
27
|
+
* })
|
|
28
|
+
* tty.write('ls -la\n')
|
|
29
|
+
* tty.write('exit\n')
|
|
30
|
+
* console.log('Exit code', await tty.wait())
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class ContainerTTYOptions extends DTO {
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
Expect(DTO.Alternatives(DTO.String(), DTO.Array(DTO.String()).min(1)).optional()),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], ContainerTTYOptions.prototype, "cmd", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
Expect(ContainerTTYConsoleSizeOptions.optional()),
|
|
41
|
+
__metadata("design:type", ContainerTTYConsoleSizeOptions
|
|
42
|
+
/**
|
|
43
|
+
* Its environment variables, added to the container's ones (and replacing them by name); `TERM` is `xterm` unless
|
|
44
|
+
* given.
|
|
45
|
+
*/
|
|
46
|
+
)
|
|
47
|
+
], ContainerTTYOptions.prototype, "consoleSize", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Expect(DTO.Object().pattern(DTO.String(), DTO.String().allow('')).optional()),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], ContainerTTYOptions.prototype, "env", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Expect(DTO.String().optional()),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ContainerTTYOptions.prototype, "workingDir", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Expect(DTO.String().optional()),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], ContainerTTYOptions.prototype, "user", void 0);
|