@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,63 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import type { ContainerdRestartPolicy } from '../../types/ContainerdRestartPolicy.js';
|
|
3
|
+
/**
|
|
4
|
+
* The settings {@link ContainerdContainer.update} changes without creating the container again (as `docker update`
|
|
5
|
+
* does): its resource limits and its restart policy. An update giving only these fields is validated by this class and
|
|
6
|
+
* applied to the container's runtime specification and, while it runs, to its cgroup; the fields not given keep their
|
|
7
|
+
* values. A limit set to `0` (`[]` for `cpuSet`) is removed at once, from the running container too, and from the
|
|
8
|
+
* settings the container is created again with. Every field is optional. An update with any other field of
|
|
9
|
+
* {@link ContainerCreateOptions} creates the container again instead.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
13
|
+
*
|
|
14
|
+
* declare const containerd: Containerd
|
|
15
|
+
*
|
|
16
|
+
* const container = await containerd.getContainer('web')
|
|
17
|
+
* //Applied to the running container
|
|
18
|
+
* await container.update({memoryLimit: 512 * 1024 * 1024, cpus: 2, restartPolicy: 'on-failure:3'})
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ContainerResourceOptions extends DTO {
|
|
22
|
+
/**
|
|
23
|
+
* The memory limit in bytes, a non-negative integer. `0` removes it, with the swap limit (unlimited memory and
|
|
24
|
+
* swap). A swap limit of twice the memory (the default one) follows the new limit; another swap limit is kept, and
|
|
25
|
+
* must stay at least the memory limit.
|
|
26
|
+
*/
|
|
27
|
+
memoryLimit?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The limit of the memory and the swap together in bytes, at least the memory limit; `-1` or `0` for unlimited
|
|
30
|
+
* swap. A positive value needs a memory limit (the container's, or `memoryLimit`). Discarded when the kernel does
|
|
31
|
+
* not limit the swap of the cgroups.
|
|
32
|
+
*/
|
|
33
|
+
memorySwap?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The CPUs the container uses at most, a non-negative number (`1.5`), as a CFS quota per period of 100000 µs; `0`
|
|
36
|
+
* removes the limit, at once.
|
|
37
|
+
*/
|
|
38
|
+
cpus?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The relative CPU weight in cgroup v1 CPU shares (`1024` is the kernel's default), a non-negative integer. `0`
|
|
41
|
+
* removes it: the running container gets the default weight (`1024` shares).
|
|
42
|
+
*/
|
|
43
|
+
cpuShares?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The CPUs the container may run on, by their numbers (`[0, 1]`). `[]` removes the restriction: the running
|
|
46
|
+
* container may run on every online CPU of the machine.
|
|
47
|
+
*/
|
|
48
|
+
cpuSet?: number[];
|
|
49
|
+
/**
|
|
50
|
+
* The processes (and threads) the container may have at most, a non-negative integer; `0` removes the limit, at
|
|
51
|
+
* once.
|
|
52
|
+
*/
|
|
53
|
+
pidsLimit?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Disable the kernel's OOM killer for the container (cgroup v1 only).
|
|
56
|
+
*/
|
|
57
|
+
OOMKillDisable?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The restart policy ({@link ContainerdRestartPolicy}); `''` or `'no'` removes it. A running container is then
|
|
60
|
+
* watched by containerd's restart monitor at once.
|
|
61
|
+
*/
|
|
62
|
+
restartPolicy?: ContainerdRestartPolicy;
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContainerResourceOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
/**
|
|
16
|
+
* The settings {@link ContainerdContainer.update} changes without creating the container again (as `docker update`
|
|
17
|
+
* does): its resource limits and its restart policy. An update giving only these fields is validated by this class and
|
|
18
|
+
* applied to the container's runtime specification and, while it runs, to its cgroup; the fields not given keep their
|
|
19
|
+
* values. A limit set to `0` (`[]` for `cpuSet`) is removed at once, from the running container too, and from the
|
|
20
|
+
* settings the container is created again with. Every field is optional. An update with any other field of
|
|
21
|
+
* {@link ContainerCreateOptions} creates the container again instead.
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
25
|
+
*
|
|
26
|
+
* declare const containerd: Containerd
|
|
27
|
+
*
|
|
28
|
+
* const container = await containerd.getContainer('web')
|
|
29
|
+
* //Applied to the running container
|
|
30
|
+
* await container.update({memoryLimit: 512 * 1024 * 1024, cpus: 2, restartPolicy: 'on-failure:3'})
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class ContainerResourceOptions extends core_1.DTO {
|
|
34
|
+
}
|
|
35
|
+
exports.ContainerResourceOptions = ContainerResourceOptions;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional()),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], ContainerResourceOptions.prototype, "memoryLimit", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().min(-1).optional()),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], ContainerResourceOptions.prototype, "memorySwap", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, dto_1.Expect)(core_1.DTO.Number().min(0).optional()),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], ContainerResourceOptions.prototype, "cpus", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional()),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], ContainerResourceOptions.prototype, "cpuShares", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Number().integer().min(0)).optional()),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], ContainerResourceOptions.prototype, "cpuSet", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional()),
|
|
58
|
+
__metadata("design:type", Number)
|
|
59
|
+
], ContainerResourceOptions.prototype, "pidsLimit", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, dto_1.Expect)(core_1.DTO.Boolean().optional()),
|
|
62
|
+
__metadata("design:type", Boolean)
|
|
63
|
+
], ContainerResourceOptions.prototype, "OOMKillDisable", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, dto_1.Expect)(core_1.DTO.String().allow('').pattern(/^(no|always|unless-stopped|on-failure(:\d+)?)$/).optional()),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], ContainerResourceOptions.prototype, "restartPolicy", void 0);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How {@link ContainerdContainer.stop} (and `restart()`) stops a container: its stop signal sent to its main process
|
|
4
|
+
* (a paused container is resumed first), then, after the timeout, `SIGKILL` sent to all its processes; its task is
|
|
5
|
+
* deleted (its exit code kept) and containerd's restart monitor told not to restart it. Every field is optional.
|
|
6
|
+
* Unlike the Docker component's options, the signal may be a number.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
10
|
+
*
|
|
11
|
+
* declare const containerd: Containerd
|
|
12
|
+
*
|
|
13
|
+
* const container = await containerd.getContainer('db')
|
|
14
|
+
* //A minute to shut down cleanly
|
|
15
|
+
* await container.stop({signal: 'SIGINT', timeout: 60})
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ContainerStopOptions extends DTO {
|
|
19
|
+
/**
|
|
20
|
+
* The seconds to wait for the container to exit after the signal before killing it, a non-negative integer.
|
|
21
|
+
* @default 10
|
|
22
|
+
*/
|
|
23
|
+
timeout?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The signal sent first: a name (`'SIGTERM'`, `'TERM'`), its number as a string, or a positive integer. By
|
|
26
|
+
* default, the container's stop signal ({@link ContainerCreateOptions.stopSignal}, the image's one), `SIGTERM`
|
|
27
|
+
* without it.
|
|
28
|
+
*/
|
|
29
|
+
signal?: string | number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContainerStopOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
/**
|
|
16
|
+
* How {@link ContainerdContainer.stop} (and `restart()`) stops a container: its stop signal sent to its main process
|
|
17
|
+
* (a paused container is resumed first), then, after the timeout, `SIGKILL` sent to all its processes; its task is
|
|
18
|
+
* deleted (its exit code kept) and containerd's restart monitor told not to restart it. Every field is optional.
|
|
19
|
+
* Unlike the Docker component's options, the signal may be a number.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
23
|
+
*
|
|
24
|
+
* declare const containerd: Containerd
|
|
25
|
+
*
|
|
26
|
+
* const container = await containerd.getContainer('db')
|
|
27
|
+
* //A minute to shut down cleanly
|
|
28
|
+
* await container.stop({signal: 'SIGINT', timeout: 60})
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
class ContainerStopOptions extends core_1.DTO {
|
|
32
|
+
}
|
|
33
|
+
exports.ContainerStopOptions = ContainerStopOptions;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional().default(10)),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], ContainerStopOptions.prototype, "timeout", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.Number().integer().positive()).optional()),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], ContainerStopOptions.prototype, "signal", void 0);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* The size of a container terminal, in characters: the initial one ({@link ContainerTTYOptions.consoleSize}), or the
|
|
4
|
+
* new one given to {@link ContainerdContainerTTY.resize}. Both fields are required.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
8
|
+
*
|
|
9
|
+
* declare const containerd: Containerd
|
|
10
|
+
*
|
|
11
|
+
* const container = await containerd.getContainer('web')
|
|
12
|
+
* const tty = await container.createTTY({consoleSize: {cols: 80, rows: 24}})
|
|
13
|
+
* //The user's window was resized
|
|
14
|
+
* await tty.resize({cols: 120, rows: 40})
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class ContainerTTYConsoleSizeOptions extends DTO {
|
|
18
|
+
/**
|
|
19
|
+
* The width in columns, a positive integer.
|
|
20
|
+
*/
|
|
21
|
+
cols: number;
|
|
22
|
+
/**
|
|
23
|
+
* The height in rows, a positive integer.
|
|
24
|
+
*/
|
|
25
|
+
rows: number;
|
|
26
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContainerTTYConsoleSizeOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
/**
|
|
16
|
+
* The size of a container terminal, in characters: the initial one ({@link ContainerTTYOptions.consoleSize}), or the
|
|
17
|
+
* new one given to {@link ContainerdContainerTTY.resize}. Both fields are required.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
21
|
+
*
|
|
22
|
+
* declare const containerd: Containerd
|
|
23
|
+
*
|
|
24
|
+
* const container = await containerd.getContainer('web')
|
|
25
|
+
* const tty = await container.createTTY({consoleSize: {cols: 80, rows: 24}})
|
|
26
|
+
* //The user's window was resized
|
|
27
|
+
* await tty.resize({cols: 120, rows: 40})
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
class ContainerTTYConsoleSizeOptions extends core_1.DTO {
|
|
31
|
+
}
|
|
32
|
+
exports.ContainerTTYConsoleSizeOptions = ContainerTTYConsoleSizeOptions;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().positive().required()),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], ContainerTTYConsoleSizeOptions.prototype, "cols", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, dto_1.Expect)(core_1.DTO.Number().integer().positive().required()),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], ContainerTTYConsoleSizeOptions.prototype, "rows", void 0);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { ContainerTTYConsoleSizeOptions } from './ContainerTTYConsoleSizeOptions.js';
|
|
3
|
+
/**
|
|
4
|
+
* The process {@link ContainerdContainer.createTTY} runs with a pseudo terminal in a running container (else it throws
|
|
5
|
+
* {@link ContainerdContainerStateException}); the terminal needs `mkfifo` on the host. Every field is optional.
|
|
6
|
+
* Unlike the Docker component's options, the environment, the working directory and the user can be set.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
10
|
+
*
|
|
11
|
+
* declare const containerd: Containerd
|
|
12
|
+
*
|
|
13
|
+
* const container = await containerd.getContainer('web')
|
|
14
|
+
* const tty = await container.createTTY({cmd: ['/bin/bash', '-l'], consoleSize: {cols: 120, rows: 40}, user: 'www-data'})
|
|
15
|
+
* tty.onData((chunk: Buffer): void => {
|
|
16
|
+
* process.stdout.write(chunk)
|
|
17
|
+
* })
|
|
18
|
+
* tty.write('ls -la\n')
|
|
19
|
+
* tty.write('exit\n')
|
|
20
|
+
* console.log('Exit code', await tty.wait())
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class ContainerTTYOptions extends DTO {
|
|
24
|
+
/**
|
|
25
|
+
* The command: its arguments (`['/bin/bash', '-l']`, at least one), run as they are, or a command line run by
|
|
26
|
+
* `/bin/sh -c` (`'top -d 1'`), as {@link ContainerExecOptions.cmd} is. The default shell is `/bin/sh`, present in
|
|
27
|
+
* every image having a shell (Alpine and BusyBox have no `bash`); an image without a shell (a distroless one) needs
|
|
28
|
+
* an array naming a program of its own.
|
|
29
|
+
* @default ['/bin/sh']
|
|
30
|
+
*/
|
|
31
|
+
cmd?: string | string[];
|
|
32
|
+
/**
|
|
33
|
+
* The initial size of the terminal; the runtime's default when not given.
|
|
34
|
+
*/
|
|
35
|
+
consoleSize?: ContainerTTYConsoleSizeOptions;
|
|
36
|
+
/**
|
|
37
|
+
* Its environment variables, added to the container's ones (and replacing them by name); `TERM` is `xterm` unless
|
|
38
|
+
* given.
|
|
39
|
+
*/
|
|
40
|
+
env?: Record<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Its working directory; the container's one by default.
|
|
43
|
+
*/
|
|
44
|
+
workingDir?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Its user: `'user'`, `'user:group'`, `'uid'` or `'uid:gid'`, the names resolved by the container's `/etc/passwd`
|
|
47
|
+
* and `/etc/group`; the container's user by default.
|
|
48
|
+
*/
|
|
49
|
+
user?: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContainerTTYOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
const ContainerTTYConsoleSizeOptions_js_1 = require("./ContainerTTYConsoleSizeOptions.js");
|
|
16
|
+
/**
|
|
17
|
+
* The process {@link ContainerdContainer.createTTY} runs with a pseudo terminal in a running container (else it throws
|
|
18
|
+
* {@link ContainerdContainerStateException}); the terminal needs `mkfifo` on the host. Every field is optional.
|
|
19
|
+
* Unlike the Docker component's options, the environment, the working directory and the user can be set.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
23
|
+
*
|
|
24
|
+
* declare const containerd: Containerd
|
|
25
|
+
*
|
|
26
|
+
* const container = await containerd.getContainer('web')
|
|
27
|
+
* const tty = await container.createTTY({cmd: ['/bin/bash', '-l'], consoleSize: {cols: 120, rows: 40}, user: 'www-data'})
|
|
28
|
+
* tty.onData((chunk: Buffer): void => {
|
|
29
|
+
* process.stdout.write(chunk)
|
|
30
|
+
* })
|
|
31
|
+
* tty.write('ls -la\n')
|
|
32
|
+
* tty.write('exit\n')
|
|
33
|
+
* console.log('Exit code', await tty.wait())
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
class ContainerTTYOptions extends core_1.DTO {
|
|
37
|
+
}
|
|
38
|
+
exports.ContainerTTYOptions = ContainerTTYOptions;
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.Array(core_1.DTO.String()).min(1)).optional()),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], ContainerTTYOptions.prototype, "cmd", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, dto_1.Expect)(ContainerTTYConsoleSizeOptions_js_1.ContainerTTYConsoleSizeOptions.optional()),
|
|
45
|
+
__metadata("design:type", ContainerTTYConsoleSizeOptions_js_1.ContainerTTYConsoleSizeOptions
|
|
46
|
+
/**
|
|
47
|
+
* Its environment variables, added to the container's ones (and replacing them by name); `TERM` is `xterm` unless
|
|
48
|
+
* given.
|
|
49
|
+
*/
|
|
50
|
+
)
|
|
51
|
+
], ContainerTTYOptions.prototype, "consoleSize", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], ContainerTTYOptions.prototype, "env", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, dto_1.Expect)(core_1.DTO.String().optional()),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], ContainerTTYOptions.prototype, "workingDir", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, dto_1.Expect)(core_1.DTO.String().optional()),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], ContainerTTYOptions.prototype, "user", void 0);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { ContainerdRegistryAuthOptions } from '../ContainerdRegistryAuthOptions.js';
|
|
3
|
+
import type { ContainerdBuildOutputCallback } from '../../types/ContainerdBuildOutputCallback.js';
|
|
4
|
+
/**
|
|
5
|
+
* How {@link Containerd.buildImage} builds an image from a Dockerfile with BuildKit (the one at the component's
|
|
6
|
+
* `buildkitAddress`, local or remote): the build context and the Dockerfile are sent by a BuildKit session, the image
|
|
7
|
+
* built is imported into containerd under `repoTag` (and pushed when asked). `workdir` and `repoTag` are required.
|
|
8
|
+
* A failure throws {@link ContainerdImageBuildException}. Unlike the Docker component's options, the context files are
|
|
9
|
+
* selected by its `.dockerignore` (there is no `files`), `repoTag` is required, several platforms can be built at once,
|
|
10
|
+
* and the image can be pushed.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
14
|
+
*
|
|
15
|
+
* declare const containerd: Containerd
|
|
16
|
+
*
|
|
17
|
+
* const image = await containerd.buildImage({
|
|
18
|
+
* workdir: '/srv/app',
|
|
19
|
+
* repoTag: 'registry.example.com/team/app:1.0',
|
|
20
|
+
* platform: ['linux/amd64', 'linux/arm64'],
|
|
21
|
+
* buildargs: {NODE_VERSION: '22'},
|
|
22
|
+
* push: true,
|
|
23
|
+
* outputCallback: (line: string): void => console.log(line)
|
|
24
|
+
* })
|
|
25
|
+
* console.log(image.name, image.platforms)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class ImageBuildOptions extends DTO {
|
|
29
|
+
/**
|
|
30
|
+
* The build context directory (absolute, or relative to the process working directory); its files excluded by its
|
|
31
|
+
* `.dockerignore` are not sent. Required.
|
|
32
|
+
*/
|
|
33
|
+
workdir: string;
|
|
34
|
+
/**
|
|
35
|
+
* The Dockerfile: a path relative to `workdir`, or an absolute one (its directory is then sent to BuildKit too).
|
|
36
|
+
* @default 'Dockerfile'
|
|
37
|
+
*/
|
|
38
|
+
dockerfile?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The name of the image built (`'app:1.0'`, `'registry.example.com/team/app:1.0'`), normalized
|
|
41
|
+
* (`'docker.io/library/app:1.0'`); a name without a tag gets `latest`. Required.
|
|
42
|
+
*/
|
|
43
|
+
repoTag: string;
|
|
44
|
+
/**
|
|
45
|
+
* The platforms built: one (`'linux/arm64'`) or several (`['linux/amd64', 'linux/arm64']`, a multi-platform
|
|
46
|
+
* image). BuildKit must build them (its workers, its emulators: {@link Containerd.buildkitPlatforms}). The platform
|
|
47
|
+
* of the machine running the application by default, even with a remote BuildKit.
|
|
48
|
+
*/
|
|
49
|
+
platform?: string | string[];
|
|
50
|
+
/**
|
|
51
|
+
* The Dockerfile stage built (`FROM … AS <target>`); `''` or absent builds the last stage.
|
|
52
|
+
*/
|
|
53
|
+
target?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The values of the Dockerfile's `ARG`s by name (`--build-arg`).
|
|
56
|
+
*/
|
|
57
|
+
buildargs?: Record<string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* The labels added to the image configuration (`--label`).
|
|
60
|
+
*/
|
|
61
|
+
labels?: Record<string, string>;
|
|
62
|
+
/**
|
|
63
|
+
* Run every step again, without BuildKit's cache.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
nocache?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve the base images' tags with their registries again, instead of using the ones BuildKit has (`--pull`).
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
pull?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Push the image built to the registry of `repoTag` once it is imported (as {@link ContainerdImage.push} does).
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
push?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The credentials of the registry of `repoTag`, used for the base images pulled from that registry and for the
|
|
79
|
+
* push; the other registries use the component's `registryAuths`. The component's credentials of that registry by
|
|
80
|
+
* default.
|
|
81
|
+
*/
|
|
82
|
+
auth?: ContainerdRegistryAuthOptions;
|
|
83
|
+
/**
|
|
84
|
+
* Receive the build progress line by line, as `docker build --progress=plain` prints it
|
|
85
|
+
* ({@link ContainerdBuildOutputCallback}).
|
|
86
|
+
*/
|
|
87
|
+
outputCallback?: ContainerdBuildOutputCallback;
|
|
88
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImageBuildOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
const ContainerdRegistryAuthOptions_js_1 = require("../ContainerdRegistryAuthOptions.js");
|
|
16
|
+
/**
|
|
17
|
+
* How {@link Containerd.buildImage} builds an image from a Dockerfile with BuildKit (the one at the component's
|
|
18
|
+
* `buildkitAddress`, local or remote): the build context and the Dockerfile are sent by a BuildKit session, the image
|
|
19
|
+
* built is imported into containerd under `repoTag` (and pushed when asked). `workdir` and `repoTag` are required.
|
|
20
|
+
* A failure throws {@link ContainerdImageBuildException}. Unlike the Docker component's options, the context files are
|
|
21
|
+
* selected by its `.dockerignore` (there is no `files`), `repoTag` is required, several platforms can be built at once,
|
|
22
|
+
* and the image can be pushed.
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
26
|
+
*
|
|
27
|
+
* declare const containerd: Containerd
|
|
28
|
+
*
|
|
29
|
+
* const image = await containerd.buildImage({
|
|
30
|
+
* workdir: '/srv/app',
|
|
31
|
+
* repoTag: 'registry.example.com/team/app:1.0',
|
|
32
|
+
* platform: ['linux/amd64', 'linux/arm64'],
|
|
33
|
+
* buildargs: {NODE_VERSION: '22'},
|
|
34
|
+
* push: true,
|
|
35
|
+
* outputCallback: (line: string): void => console.log(line)
|
|
36
|
+
* })
|
|
37
|
+
* console.log(image.name, image.platforms)
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
class ImageBuildOptions extends core_1.DTO {
|
|
41
|
+
}
|
|
42
|
+
exports.ImageBuildOptions = ImageBuildOptions;
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, dto_1.Expect)(core_1.DTO.String().required()),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], ImageBuildOptions.prototype, "workdir", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, dto_1.Expect)(core_1.DTO.String().optional().default('Dockerfile')),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], ImageBuildOptions.prototype, "dockerfile", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, dto_1.Expect)(core_1.DTO.String().required()),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], ImageBuildOptions.prototype, "repoTag", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.Array(core_1.DTO.String()).min(1)).optional()),
|
|
57
|
+
__metadata("design:type", Object)
|
|
58
|
+
], ImageBuildOptions.prototype, "platform", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, dto_1.Expect)(core_1.DTO.String().allow('').optional()),
|
|
61
|
+
__metadata("design:type", String)
|
|
62
|
+
], ImageBuildOptions.prototype, "target", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], ImageBuildOptions.prototype, "buildargs", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], ImageBuildOptions.prototype, "labels", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(false)),
|
|
73
|
+
__metadata("design:type", Boolean)
|
|
74
|
+
], ImageBuildOptions.prototype, "nocache", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(false)),
|
|
77
|
+
__metadata("design:type", Boolean)
|
|
78
|
+
], ImageBuildOptions.prototype, "pull", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(false)),
|
|
81
|
+
__metadata("design:type", Boolean)
|
|
82
|
+
], ImageBuildOptions.prototype, "push", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, dto_1.Expect)(ContainerdRegistryAuthOptions_js_1.ContainerdRegistryAuthOptions.optional()),
|
|
85
|
+
__metadata("design:type", ContainerdRegistryAuthOptions_js_1.ContainerdRegistryAuthOptions
|
|
86
|
+
/**
|
|
87
|
+
* Receive the build progress line by line, as `docker build --progress=plain` prints it
|
|
88
|
+
* ({@link ContainerdBuildOutputCallback}).
|
|
89
|
+
*/
|
|
90
|
+
)
|
|
91
|
+
], ImageBuildOptions.prototype, "auth", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, dto_1.Expect)(core_1.DTO.Function().optional()),
|
|
94
|
+
__metadata("design:type", Function)
|
|
95
|
+
], ImageBuildOptions.prototype, "outputCallback", void 0);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* Where {@link Containerd.exportImages} and {@link ContainerdImage.export} write their tar archive: an OCI image layout
|
|
4
|
+
* holding every platform the content store has of each image, named by its annotations, with the `manifest.json`
|
|
5
|
+
* `docker load` reads (the machine's platform, or the first one). {@link Containerd.importImage}, `nerdctl load`,
|
|
6
|
+
* `ctr images import` and `docker load` load it. `destination` is required. Unlike the Docker component's options,
|
|
7
|
+
* the images keep their names (there is no `repoTag`).
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
11
|
+
*
|
|
12
|
+
* declare const containerd: Containerd
|
|
13
|
+
*
|
|
14
|
+
* await containerd.exportImages(['nginx:1.27', 'redis:7'], {destination: '/backup/images.tar'})
|
|
15
|
+
* const image = await containerd.getImage('nginx:1.27')
|
|
16
|
+
* await image.export({destination: '/backup/nginx.tar'})
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class ImageExportOptions extends DTO {
|
|
20
|
+
/**
|
|
21
|
+
* Where the archive is written: the path of a file, created or replaced, or a writable stream, ended once the
|
|
22
|
+
* archive is written. Required.
|
|
23
|
+
*/
|
|
24
|
+
destination: string | NodeJS.WritableStream;
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ImageExportOptions = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
15
|
+
const node_stream_1 = require("node:stream");
|
|
16
|
+
/**
|
|
17
|
+
* Where {@link Containerd.exportImages} and {@link ContainerdImage.export} write their tar archive: an OCI image layout
|
|
18
|
+
* holding every platform the content store has of each image, named by its annotations, with the `manifest.json`
|
|
19
|
+
* `docker load` reads (the machine's platform, or the first one). {@link Containerd.importImage}, `nerdctl load`,
|
|
20
|
+
* `ctr images import` and `docker load` load it. `destination` is required. Unlike the Docker component's options,
|
|
21
|
+
* the images keep their names (there is no `repoTag`).
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
25
|
+
*
|
|
26
|
+
* declare const containerd: Containerd
|
|
27
|
+
*
|
|
28
|
+
* await containerd.exportImages(['nginx:1.27', 'redis:7'], {destination: '/backup/images.tar'})
|
|
29
|
+
* const image = await containerd.getImage('nginx:1.27')
|
|
30
|
+
* await image.export({destination: '/backup/nginx.tar'})
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
class ImageExportOptions extends core_1.DTO {
|
|
34
|
+
}
|
|
35
|
+
exports.ImageExportOptions = ImageExportOptions;
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.InstanceOf(node_stream_1.Stream)).required()),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], ImageExportOptions.prototype, "destination", void 0);
|