@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,30 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* The signal {@link ContainerdContainer.kill} sends to a running container, without waiting for it to exit. Every
|
|
4
|
+
* field is optional. A `SIGKILL` also tells containerd's restart monitor not to restart the container; the other
|
|
5
|
+
* signals do not. Unlike the Docker component's options, the signal may be a number, and all the processes can be
|
|
6
|
+
* signaled.
|
|
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
|
+
* //Reload nginx's configuration
|
|
15
|
+
* await container.kill({signal: 'SIGHUP'})
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ContainerKillOptions extends DTO {
|
|
19
|
+
/**
|
|
20
|
+
* The signal: a name (`'SIGTERM'`, `'TERM'`), its number as a string (`'15'`), or a positive integer. An unknown
|
|
21
|
+
* name fails the call.
|
|
22
|
+
* @default 'SIGKILL'
|
|
23
|
+
*/
|
|
24
|
+
signal?: string | number;
|
|
25
|
+
/**
|
|
26
|
+
* Send it to all the container's processes, not only to its main process.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
all?: boolean;
|
|
30
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How {@link ContainerdContainer.logs} reads a container's logs: the file its containerd shim writes its standard
|
|
4
|
+
* output and error to, interleaved and raw (no timestamps, no stream prefix), with its previous rotated file (the
|
|
5
|
+
* component's `logMaxSize` option). Every field is optional. Unlike the Docker component's options, there is no
|
|
6
|
+
* `since`, `until` nor `timestamps`.
|
|
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
|
+
* //The last 100 lines, then the new ones while it runs
|
|
15
|
+
* const logs = await container.logs({tail: 100})
|
|
16
|
+
* logs.on('data', (chunk: Buffer): void => {
|
|
17
|
+
* process.stdout.write(chunk)
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ContainerLogsOptions extends DTO {
|
|
22
|
+
/**
|
|
23
|
+
* Keep the stream open and send the new output while the container runs (polled every 250 milliseconds); it ends
|
|
24
|
+
* once the container stops without its restart monitor restarting it. Without it, the stream ends after the
|
|
25
|
+
* existing logs.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
follow?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The number of lines read from the end of the existing logs, a non-negative integer (`0`: none of them); all of
|
|
31
|
+
* them by default.
|
|
32
|
+
*/
|
|
33
|
+
tail?: number;
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How {@link ContainerdContainer.remove} removes a container, with its snapshot, its network interfaces and its state
|
|
4
|
+
* directory (its logs); its named volumes are kept. The field is optional.
|
|
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
|
+
* await container.remove({force: true})
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class ContainerRemoveOptions extends DTO {
|
|
16
|
+
/**
|
|
17
|
+
* Remove a running or paused container: all its processes are killed (`SIGKILL`) first, and its restart monitor
|
|
18
|
+
* told not to restart it. Without it, such a container throws {@link ContainerdContainerStateException}.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
force?: boolean;
|
|
22
|
+
}
|
|
@@ -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,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,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,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,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,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,38 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How {@link Containerd.importImage} loads the images of a tar archive into containerd, returning them: an OCI image
|
|
4
|
+
* layout (the archive of {@link ImageExportOptions}, `nerdctl save`, `docker save` of Docker 25+), or an archive of an
|
|
5
|
+
* older `docker save`. `source` is required. An archive with no image throws {@link ContainerdImageImportException}.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import {createReadStream} from 'node:fs'
|
|
9
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
10
|
+
*
|
|
11
|
+
* declare const containerd: Containerd
|
|
12
|
+
*
|
|
13
|
+
* const images = await containerd.importImage({source: '/backup/images.tar'})
|
|
14
|
+
* //Or from a stream (an upload, a download), under another name
|
|
15
|
+
* const [copy] = await containerd.importImage({source: createReadStream('/backup/nginx.tar'), name: 'nginx:backup'})
|
|
16
|
+
* console.log(images.map(image => image.name), copy.name)
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class ImageImportOptions extends DTO {
|
|
20
|
+
/**
|
|
21
|
+
* The archive: the path of a file, or a readable stream of it. Required.
|
|
22
|
+
*/
|
|
23
|
+
source: string | NodeJS.ReadableStream;
|
|
24
|
+
/**
|
|
25
|
+
* The name given to the imported image (`'app:1.0'`, normalized to `'docker.io/library/app:1.0'`), instead of the
|
|
26
|
+
* names the archive has. Only for an archive of one image (its tags count as one): an archive of several images
|
|
27
|
+
* given a name throws {@link ContainerdImageImportException}, nothing imported. By default, the archive's names; an
|
|
28
|
+
* older `docker save` image without one is named `import-<milliseconds>@<digest>`.
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Unpack the images' layers into snapshots, for the platforms the machine runs
|
|
33
|
+
* ({@link Containerd.supportedPlatforms}), so that their containers are created at once. A failure to unpack fails the import with
|
|
34
|
+
* {@link ContainerdImageImportException}, the images stored and named.
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
unpack?: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { ContainerdRegistryAuthOptions } from '../ContainerdRegistryAuthOptions.js';
|
|
3
|
+
import type { ContainerdProgressCallback } from '../../types/ContainerdProgressCallback.js';
|
|
4
|
+
/**
|
|
5
|
+
* How {@link Containerd.pullImage} pulls an image from its registry into containerd, returning it: the manifests of the
|
|
6
|
+
* platforms asked, their configurations and their layers. Only `image` is required. A failure throws
|
|
7
|
+
* {@link ContainerdImagePullException}; a platform the image does not have throws {@link ContainerdPlatformException}.
|
|
8
|
+
* The registries in the component's `insecureRegistries` are accessed over HTTP. Unlike the Docker component's options,
|
|
9
|
+
* the image is one reference (no `repo` and `tag`), several platforms can be pulled, and the progress is reported per
|
|
10
|
+
* blob in bytes.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
14
|
+
*
|
|
15
|
+
* declare const containerd: Containerd
|
|
16
|
+
*
|
|
17
|
+
* const image = await containerd.pullImage({
|
|
18
|
+
* image: 'alpine:3.20',
|
|
19
|
+
* platform: ['linux/amd64', 'linux/arm64'],
|
|
20
|
+
* progressCallback: ({digest, current, total}): void => console.log(digest, current, '/', total)
|
|
21
|
+
* })
|
|
22
|
+
* console.log(image.name, image.platforms)
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare class ImagePullOptions extends DTO {
|
|
26
|
+
/**
|
|
27
|
+
* The image reference (`'alpine'`, `'alpine:3.20'`, `'registry.example.com:5000/app@sha256:…'`), normalized as
|
|
28
|
+
* Docker does (`'docker.io/library/alpine:latest'`), the tag `latest` when it has neither a tag nor a digest. The
|
|
29
|
+
* image is named by it in containerd. Required.
|
|
30
|
+
*/
|
|
31
|
+
image: string;
|
|
32
|
+
/**
|
|
33
|
+
* The platforms pulled: one (`'linux/arm64'`, `'linux/arm/v7'`, `'arm64'` for `linux/arm64`) or several, or
|
|
34
|
+
* `'all'` for every platform of the image. The machine's platform by default.
|
|
35
|
+
*/
|
|
36
|
+
platform?: string | string[];
|
|
37
|
+
/**
|
|
38
|
+
* The credentials of the image's registry; the component's credentials of that registry (`registryAuths`) by
|
|
39
|
+
* default, anonymous without them.
|
|
40
|
+
*/
|
|
41
|
+
auth?: ContainerdRegistryAuthOptions;
|
|
42
|
+
/**
|
|
43
|
+
* Unpack the layers into snapshots, for the platforms pulled that the machine runs
|
|
44
|
+
* ({@link Containerd.supportedPlatforms}: its own and the ones of its emulators), so that their containers are
|
|
45
|
+
* created at once; the other platforms are only stored. Without it, a container creation unpacks them.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
unpack?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Receive the download progress of each blob ({@link ContainerdProgressCallback}).
|
|
51
|
+
*/
|
|
52
|
+
progressCallback?: ContainerdProgressCallback;
|
|
53
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { ContainerdRegistryAuthOptions } from '../ContainerdRegistryAuthOptions.js';
|
|
3
|
+
import type { ContainerdProgressCallback } from '../../types/ContainerdProgressCallback.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where and how {@link ContainerdImage.push} pushes an image to a registry: an image of one manifest as it is; the
|
|
6
|
+
* manifest of `platform` when it is given; else the whole index of a multi-platform image when the content store has
|
|
7
|
+
* all its platforms, the manifest of the machine's platform otherwise. Every field is optional. A failure throws
|
|
8
|
+
* {@link ContainerdImagePushException}. The registries in the component's `insecureRegistries` are accessed over HTTP.
|
|
9
|
+
* Unlike the Docker component's options, the destination is one reference (no `repo` and `tag`), the image is not
|
|
10
|
+
* tagged with it in containerd, and the identity tokens are sent.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
14
|
+
*
|
|
15
|
+
* declare const containerd: Containerd
|
|
16
|
+
*
|
|
17
|
+
* const image = await containerd.getImage('app:1.0')
|
|
18
|
+
* await image.push({
|
|
19
|
+
* reference: 'registry.example.com:5000/team/app:1.0',
|
|
20
|
+
* auth: {username: 'ci', password: process.env.REGISTRY_TOKEN ?? ''}
|
|
21
|
+
* })
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ImagePushOptions extends DTO {
|
|
25
|
+
/**
|
|
26
|
+
* The reference pushed to (`'registry.example.com:5000/team/app:1.0'`); the image's name by default.
|
|
27
|
+
*/
|
|
28
|
+
reference?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The platform whose manifest alone is pushed under the reference (`'linux/arm64'`), even when the content store
|
|
31
|
+
* has all the platforms of the image's index. Without it, the whole index is pushed when all its platforms are
|
|
32
|
+
* present, else the machine's platform. An image without the platform throws {@link ContainerdPlatformException}.
|
|
33
|
+
*/
|
|
34
|
+
platform?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The credentials of the registry of the reference; the component's credentials of that registry
|
|
37
|
+
* (`registryAuths`) by default.
|
|
38
|
+
*/
|
|
39
|
+
auth?: ContainerdRegistryAuthOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Receive the upload progress ({@link ContainerdProgressCallback}): once per blob, after its upload.
|
|
42
|
+
*/
|
|
43
|
+
progressCallback?: ContainerdProgressCallback;
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* A CNI network {@link Containerd.createNetwork} creates, as `nerdctl network create` does: its configuration list
|
|
4
|
+
* `nerdctl-<name>.conflist` written to the component's `cniConfigPath` (nerdctl sees it), its main plugin followed by
|
|
5
|
+
* `portmap`, and `firewall` and `tuning` when they are installed. Containers join it by
|
|
6
|
+
* {@link ContainerCreateOptions.networks}. Only `name` is required. A name or a subnet in use throws
|
|
7
|
+
* {@link ContainerdNetworkConflictException}. Unlike the Docker component's options, the IPAM settings are flat fields
|
|
8
|
+
* (one IPv4 subnet, one IPv6 subnet), and IPv6 is enabled by giving its subnet.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
12
|
+
*
|
|
13
|
+
* declare const containerd: Containerd
|
|
14
|
+
*
|
|
15
|
+
* const network = await containerd.createNetwork({
|
|
16
|
+
* name: 'backend',
|
|
17
|
+
* subnet: '10.20.0.0/24',
|
|
18
|
+
* ipRange: '10.20.0.128/25',
|
|
19
|
+
* labels: {project: 'shop'}
|
|
20
|
+
* })
|
|
21
|
+
* await containerd.createContainer({image: 'redis:7', networks: [{networkName: network.name, ip: '10.20.0.10'}]})
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class NetworkCreateOptions extends DTO {
|
|
25
|
+
/**
|
|
26
|
+
* The name of the network, matching `[a-zA-Z0-9][a-zA-Z0-9_.-]*`; not `host`, `none` nor `bridge` (the default
|
|
27
|
+
* nerdctl network). Required.
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* The main CNI plugin, installed in the component's `cniPath`: `'bridge'`, a Linux bridge (`br-<12 digits of its
|
|
32
|
+
* ID>`) with NAT to the outside; `'macvlan'` (bridge mode) or `'ipvlan'` (L2 mode), the containers on the network
|
|
33
|
+
* of the host interface `parent`.
|
|
34
|
+
* @default 'bridge'
|
|
35
|
+
*/
|
|
36
|
+
driver?: 'bridge' | 'ipvlan' | 'macvlan';
|
|
37
|
+
/**
|
|
38
|
+
* The IPv4 subnet in CIDR notation (`'10.20.0.0/24'`), overlapping no other network's. By default, the first free
|
|
39
|
+
* `/24` of `10.4.0.0/16` (the nerdctl range, `10.4.0.0/24` being the default network's).
|
|
40
|
+
*/
|
|
41
|
+
subnet?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The IPv4 gateway, an address of the subnet without a prefix length (`'10.20.0.254'`); the first address of the
|
|
44
|
+
* subnet by default.
|
|
45
|
+
*/
|
|
46
|
+
gateway?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The range the container addresses are given from, in CIDR notation inside the subnet (`'10.20.0.128/25'`); the
|
|
49
|
+
* whole subnet by default.
|
|
50
|
+
*/
|
|
51
|
+
ipRange?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The host interface (`'eth0'`) a `macvlan` or `ipvlan` network is attached to, required by them; ignored by
|
|
54
|
+
* `bridge`.
|
|
55
|
+
*/
|
|
56
|
+
parent?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Cut the network from the outside: no default route in the containers and, for a bridge, no gateway on the host
|
|
59
|
+
* and no masquerading.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
internal?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The MTU of the container interfaces in bytes, at least `68`; the plugin's default (the host's, `1500` usually)
|
|
65
|
+
* when not given.
|
|
66
|
+
*/
|
|
67
|
+
mtu?: number;
|
|
68
|
+
/**
|
|
69
|
+
* An IPv6 subnet in CIDR notation (`'fd00:4:10::/64'`), besides the IPv4 one, overlapping no other network's; the
|
|
70
|
+
* network has no IPv6 without it.
|
|
71
|
+
*/
|
|
72
|
+
ipv6Subnet?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The IPv6 gateway, an address of `ipv6Subnet` without a prefix length; the first address of the subnet by
|
|
75
|
+
* default. Ignored without `ipv6Subnet`.
|
|
76
|
+
*/
|
|
77
|
+
ipv6Gateway?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The labels of the network, written to its configuration.
|
|
80
|
+
*/
|
|
81
|
+
labels?: Record<string, string>;
|
|
82
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* A named volume {@link Containerd.createVolume} creates: an empty directory of the component's data root
|
|
4
|
+
* (`<dataRoot>/volumes/<namespace>/<name>/_data`), which containers mount by {@link ContainerCreateOptions.volumes}.
|
|
5
|
+
* It is not a nerdctl volume. When the volume exists, it is returned unchanged (its labels kept), as Docker does. Only
|
|
6
|
+
* `name` is required.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {Containerd} from 'lakutata/com/containerd'
|
|
10
|
+
*
|
|
11
|
+
* declare const containerd: Containerd
|
|
12
|
+
*
|
|
13
|
+
* const volume = await containerd.createVolume({name: 'pgdata', labels: {project: 'shop'}})
|
|
14
|
+
* await containerd.createContainer({image: 'postgres:16', volumes: [{volumeName: volume.name, containerPath: '/var/lib/postgresql/data'}]})
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class VolumeCreateOptions extends DTO {
|
|
18
|
+
/**
|
|
19
|
+
* The name of the volume, matching `[a-zA-Z0-9][a-zA-Z0-9_.-]*`. Required.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* The labels of the volume, kept with it ({@link ContainerdVolumeInfo.labels}); ignored when it exists.
|
|
24
|
+
*/
|
|
25
|
+
labels?: Record<string, string>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A directory or a file of the host mounted into a container (a bind mount), given to
|
|
3
|
+
* {@link ContainerCreateOptions.binds}. Unlike the Docker component's bind, `rw` is optional and the mount propagation
|
|
4
|
+
* can be set.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerdBind = {
|
|
7
|
+
/**
|
|
8
|
+
* The path on the host, absolute or relative to the working directory of the process. A missing path is created
|
|
9
|
+
* as a directory when the container is created (as `docker run -v` does).
|
|
10
|
+
*/
|
|
11
|
+
hostPath: string;
|
|
12
|
+
/**
|
|
13
|
+
* The absolute path in the container where it is mounted; it replaces what the image has there.
|
|
14
|
+
*/
|
|
15
|
+
containerPath: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the container can write to it; `false` mounts it read only.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
rw?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The mount propagation (how the mounts made later under the path on either side are seen by the other side):
|
|
23
|
+
* `'private'`/`'rprivate'` none, `'shared'`/`'rshared'` both ways, `'slave'`/`'rslave'` from the host into the
|
|
24
|
+
* container only. The `r` forms apply to the mounts under the path too.
|
|
25
|
+
* @default 'rprivate'
|
|
26
|
+
*/
|
|
27
|
+
propagation?: 'private' | 'rprivate' | 'shared' | 'rshared' | 'slave' | 'rslave';
|
|
28
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receive the progress of a BuildKit build ({@link ImageBuildOptions.outputCallback}), one line per call, as
|
|
3
|
+
* `docker build --progress=plain` prints it: the steps numbered in their order (`"#3 [2/2] RUN npm ci"`), their output,
|
|
4
|
+
* and their end (`"#3 CACHED"`, `"#3 DONE 1.2s"`, or their error). The line has no trailing newline.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerdBuildOutputCallback = (line: string) => void;
|