@lakutata/docker 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 +309 -0
- package/THIRD_PARTY_NOTICES.md +299 -0
- package/dist/cjs/client/BuildContext.d.ts +22 -0
- package/dist/cjs/client/BuildContext.js +76 -0
- package/dist/cjs/client/BuildKitProgress.d.ts +81 -0
- package/dist/cjs/client/BuildKitProgress.js +195 -0
- package/dist/cjs/client/DockerClient.d.ts +196 -0
- package/dist/cjs/client/DockerClient.js +312 -0
- package/dist/cjs/client/DockerConnection.d.ts +154 -0
- package/dist/cjs/client/DockerConnection.js +397 -0
- package/dist/cjs/client/DockerIgnore.d.ts +44 -0
- package/dist/cjs/client/DockerIgnore.js +186 -0
- package/dist/cjs/client/DockerRequestError.d.ts +17 -0
- package/dist/cjs/client/DockerRequestError.js +24 -0
- package/dist/cjs/client/DockerStreams.d.ts +35 -0
- package/dist/cjs/client/DockerStreams.js +117 -0
- package/dist/cjs/client/types/ContainerCreateResponse.d.ts +7 -0
- package/dist/cjs/client/types/ContainerCreateResponse.js +2 -0
- package/dist/cjs/client/types/ContainerStopQuery.d.ts +13 -0
- package/dist/cjs/client/types/ContainerStopQuery.js +2 -0
- package/dist/cjs/client/types/DeviceMapping.d.ts +8 -0
- package/dist/cjs/client/types/DeviceMapping.js +2 -0
- package/dist/cjs/client/types/IdResponse.d.ts +6 -0
- package/dist/cjs/client/types/IdResponse.js +2 -0
- package/dist/cjs/client/types/NetworkCreateResponse.d.ts +7 -0
- package/dist/cjs/client/types/NetworkCreateResponse.js +2 -0
- package/dist/cjs/client/types/PortBinding.d.ts +10 -0
- package/dist/cjs/client/types/PortBinding.js +2 -0
- package/dist/cjs/docker/ConnectionOptionsBuilder.d.ts +128 -0
- package/dist/cjs/docker/ConnectionOptionsBuilder.js +150 -0
- package/dist/cjs/docker/Docker.d.ts +301 -0
- package/dist/cjs/docker/Docker.js +703 -0
- package/dist/cjs/docker/exceptions/DockerConnectionException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerConnectionException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerContainerNotFoundException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerContainerNotFoundException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerImageBuildException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerImageBuildException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerImageImportException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerImageImportException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerImageNotFoundException.d.ts +10 -0
- package/dist/cjs/docker/exceptions/DockerImageNotFoundException.js +17 -0
- package/dist/cjs/docker/exceptions/DockerImagePullException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerImagePullException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerImagePushException.d.ts +8 -0
- package/dist/cjs/docker/exceptions/DockerImagePushException.js +15 -0
- package/dist/cjs/docker/exceptions/DockerImageRepoTagNotFoundException.d.ts +8 -0
- package/dist/cjs/docker/exceptions/DockerImageRepoTagNotFoundException.js +15 -0
- package/dist/cjs/docker/exceptions/DockerNetworkNotFoundException.d.ts +9 -0
- package/dist/cjs/docker/exceptions/DockerNetworkNotFoundException.js +16 -0
- package/dist/cjs/docker/exceptions/DockerRequestException.d.ts +22 -0
- package/dist/cjs/docker/exceptions/DockerRequestException.js +24 -0
- package/dist/cjs/docker/interfaces/IDockerConnectionOptions.d.ts +75 -0
- package/dist/cjs/docker/interfaces/IDockerConnectionOptions.js +2 -0
- package/dist/cjs/docker/interfaces/IDockerHttpConnectionOptions.d.ts +16 -0
- package/dist/cjs/docker/interfaces/IDockerHttpConnectionOptions.js +2 -0
- package/dist/cjs/docker/interfaces/IDockerHttpsConnectionOptions.d.ts +16 -0
- package/dist/cjs/docker/interfaces/IDockerHttpsConnectionOptions.js +2 -0
- package/dist/cjs/docker/interfaces/IDockerKeyObject.d.ts +14 -0
- package/dist/cjs/docker/interfaces/IDockerKeyObject.js +2 -0
- package/dist/cjs/docker/interfaces/IDockerSSHConnectionOptions.d.ts +16 -0
- package/dist/cjs/docker/interfaces/IDockerSSHConnectionOptions.js +2 -0
- package/dist/cjs/docker/interfaces/IDockerSocketConnectionOptions.d.ts +7 -0
- package/dist/cjs/docker/interfaces/IDockerSocketConnectionOptions.js +2 -0
- package/dist/cjs/docker/lib/DockerContainer.d.ts +315 -0
- package/dist/cjs/docker/lib/DockerContainer.js +742 -0
- package/dist/cjs/docker/lib/DockerContainerTTY.d.ts +99 -0
- package/dist/cjs/docker/lib/DockerContainerTTY.js +157 -0
- package/dist/cjs/docker/lib/DockerImage.d.ts +153 -0
- package/dist/cjs/docker/lib/DockerImage.js +273 -0
- package/dist/cjs/docker/lib/EngineSettings.d.ts +41 -0
- package/dist/cjs/docker/lib/EngineSettings.js +86 -0
- package/dist/cjs/docker/lib/ParseBaseImages.d.ts +9 -0
- package/dist/cjs/docker/lib/ParseBaseImages.js +50 -0
- package/dist/cjs/docker/lib/ParseEnvToRecord.d.ts +14 -0
- package/dist/cjs/docker/lib/ParseEnvToRecord.js +25 -0
- package/dist/cjs/docker/lib/ParseRepositoryTag.d.ts +17 -0
- package/dist/cjs/docker/lib/ParseRepositoryTag.js +48 -0
- package/dist/cjs/docker/lib/RegistryAuth.d.ts +8 -0
- package/dist/cjs/docker/lib/RegistryAuth.js +15 -0
- package/dist/cjs/docker/options/DockerPruneOptions.d.ts +38 -0
- package/dist/cjs/docker/options/DockerPruneOptions.js +47 -0
- package/dist/cjs/docker/options/auth/DockerAuthOptions.d.ts +46 -0
- package/dist/cjs/docker/options/auth/DockerAuthOptions.js +59 -0
- package/dist/cjs/docker/options/container/ContainerCommitOptions.d.ts +28 -0
- package/dist/cjs/docker/options/container/ContainerCommitOptions.js +39 -0
- package/dist/cjs/docker/options/container/ContainerCreateTTYOptions.d.ts +32 -0
- package/dist/cjs/docker/options/container/ContainerCreateTTYOptions.js +43 -0
- package/dist/cjs/docker/options/container/ContainerExecOptions.d.ts +26 -0
- package/dist/cjs/docker/options/container/ContainerExecOptions.js +38 -0
- package/dist/cjs/docker/options/container/ContainerExportDirectoryOptions.d.ts +27 -0
- package/dist/cjs/docker/options/container/ContainerExportDirectoryOptions.js +39 -0
- package/dist/cjs/docker/options/container/ContainerKillOptions.d.ts +25 -0
- package/dist/cjs/docker/options/container/ContainerKillOptions.js +36 -0
- package/dist/cjs/docker/options/container/ContainerLogsOptions.d.ts +48 -0
- package/dist/cjs/docker/options/container/ContainerLogsOptions.js +56 -0
- package/dist/cjs/docker/options/container/ContainerRemoveOptions.d.ts +22 -0
- package/dist/cjs/docker/options/container/ContainerRemoveOptions.js +34 -0
- package/dist/cjs/docker/options/container/ContainerSettingOptions.d.ts +137 -0
- package/dist/cjs/docker/options/container/ContainerSettingOptions.js +136 -0
- package/dist/cjs/docker/options/container/ContainerStopOptions.d.ts +28 -0
- package/dist/cjs/docker/options/container/ContainerStopOptions.js +40 -0
- package/dist/cjs/docker/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
- package/dist/cjs/docker/options/container/ContainerTTYConsoleSizeOptions.js +40 -0
- package/dist/cjs/docker/options/image/ImageBuildOptions.d.ts +117 -0
- package/dist/cjs/docker/options/image/ImageBuildOptions.js +111 -0
- package/dist/cjs/docker/options/image/ImageExportOptions.d.ts +33 -0
- package/dist/cjs/docker/options/image/ImageExportOptions.js +44 -0
- package/dist/cjs/docker/options/image/ImageImportOptions.d.ts +28 -0
- package/dist/cjs/docker/options/image/ImageImportOptions.js +42 -0
- package/dist/cjs/docker/options/image/ImagePullOptions.d.ts +49 -0
- package/dist/cjs/docker/options/image/ImagePullOptions.js +63 -0
- package/dist/cjs/docker/options/image/ImagePushOptions.d.ts +41 -0
- package/dist/cjs/docker/options/image/ImagePushOptions.js +56 -0
- package/dist/cjs/docker/options/image/ImageRemoveOptions.d.ts +26 -0
- package/dist/cjs/docker/options/image/ImageRemoveOptions.js +38 -0
- package/dist/cjs/docker/options/image/ImageTagOptions.d.ts +25 -0
- package/dist/cjs/docker/options/image/ImageTagOptions.js +38 -0
- package/dist/cjs/docker/options/network/NetworkCreateOptions.d.ts +54 -0
- package/dist/cjs/docker/options/network/NetworkCreateOptions.js +63 -0
- package/dist/cjs/docker/types/ContainerBind.d.ts +19 -0
- package/dist/cjs/docker/types/ContainerBind.js +2 -0
- package/dist/cjs/docker/types/ContainerCapability.d.ts +286 -0
- package/dist/cjs/docker/types/ContainerCapability.js +290 -0
- package/dist/cjs/docker/types/ContainerConfig.d.ts +67 -0
- package/dist/cjs/docker/types/ContainerConfig.js +2 -0
- package/dist/cjs/docker/types/ContainerDevice.d.ts +19 -0
- package/dist/cjs/docker/types/ContainerDevice.js +2 -0
- package/dist/cjs/docker/types/ContainerExecResult.d.ts +20 -0
- package/dist/cjs/docker/types/ContainerExecResult.js +2 -0
- package/dist/cjs/docker/types/ContainerNetwork.d.ts +46 -0
- package/dist/cjs/docker/types/ContainerNetwork.js +2 -0
- package/dist/cjs/docker/types/ContainerPort.d.ts +25 -0
- package/dist/cjs/docker/types/ContainerPort.js +2 -0
- package/dist/cjs/docker/types/ContainerRestartPolicy.d.ts +11 -0
- package/dist/cjs/docker/types/ContainerRestartPolicy.js +2 -0
- package/dist/cjs/docker/types/ContainerState.d.ts +48 -0
- package/dist/cjs/docker/types/ContainerState.js +2 -0
- package/dist/cjs/docker/types/ContainerStats.d.ts +408 -0
- package/dist/cjs/docker/types/ContainerStats.js +2 -0
- package/dist/cjs/docker/types/DockerOutputCallback.d.ts +8 -0
- package/dist/cjs/docker/types/DockerOutputCallback.js +2 -0
- package/dist/cjs/docker/types/ImageConfig.d.ts +34 -0
- package/dist/cjs/docker/types/ImageConfig.js +2 -0
- package/dist/cjs/docker/types/ImageExposePort.d.ts +17 -0
- package/dist/cjs/docker/types/ImageExposePort.js +2 -0
- package/dist/cjs/docker/types/NetworkInfo.d.ts +59 -0
- package/dist/cjs/docker/types/NetworkInfo.js +2 -0
- package/dist/cjs/docker/types/RepositoryTag.d.ts +15 -0
- package/dist/cjs/docker/types/RepositoryTag.js +2 -0
- package/dist/cjs/exports/Docker.d.ts +73 -0
- package/dist/cjs/exports/Docker.js +92 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/client/BuildContext.js +70 -0
- package/dist/esm/client/BuildKitProgress.js +190 -0
- package/dist/esm/client/DockerClient.js +307 -0
- package/dist/esm/client/DockerConnection.js +355 -0
- package/dist/esm/client/DockerIgnore.js +179 -0
- package/dist/esm/client/DockerRequestError.js +20 -0
- package/dist/esm/client/DockerStreams.js +111 -0
- package/dist/esm/client/types/ContainerCreateResponse.js +1 -0
- package/dist/esm/client/types/ContainerStopQuery.js +1 -0
- package/dist/esm/client/types/DeviceMapping.js +1 -0
- package/dist/esm/client/types/IdResponse.js +1 -0
- package/dist/esm/client/types/NetworkCreateResponse.js +1 -0
- package/dist/esm/client/types/PortBinding.js +1 -0
- package/dist/esm/docker/ConnectionOptionsBuilder.js +142 -0
- package/dist/esm/docker/Docker.js +697 -0
- package/dist/esm/docker/exceptions/DockerConnectionException.js +12 -0
- package/dist/esm/docker/exceptions/DockerContainerNotFoundException.js +12 -0
- package/dist/esm/docker/exceptions/DockerImageBuildException.js +12 -0
- package/dist/esm/docker/exceptions/DockerImageImportException.js +12 -0
- package/dist/esm/docker/exceptions/DockerImageNotFoundException.js +13 -0
- package/dist/esm/docker/exceptions/DockerImagePullException.js +12 -0
- package/dist/esm/docker/exceptions/DockerImagePushException.js +11 -0
- package/dist/esm/docker/exceptions/DockerImageRepoTagNotFoundException.js +11 -0
- package/dist/esm/docker/exceptions/DockerNetworkNotFoundException.js +12 -0
- package/dist/esm/docker/exceptions/DockerRequestException.js +20 -0
- package/dist/esm/docker/interfaces/IDockerConnectionOptions.js +1 -0
- package/dist/esm/docker/interfaces/IDockerHttpConnectionOptions.js +1 -0
- package/dist/esm/docker/interfaces/IDockerHttpsConnectionOptions.js +1 -0
- package/dist/esm/docker/interfaces/IDockerKeyObject.js +1 -0
- package/dist/esm/docker/interfaces/IDockerSSHConnectionOptions.js +1 -0
- package/dist/esm/docker/interfaces/IDockerSocketConnectionOptions.js +1 -0
- package/dist/esm/docker/lib/DockerContainer.js +739 -0
- package/dist/esm/docker/lib/DockerContainerTTY.js +154 -0
- package/dist/esm/docker/lib/DockerImage.js +270 -0
- package/dist/esm/docker/lib/EngineSettings.js +78 -0
- package/dist/esm/docker/lib/ParseBaseImages.js +47 -0
- package/dist/esm/docker/lib/ParseEnvToRecord.js +22 -0
- package/dist/esm/docker/lib/ParseRepositoryTag.js +45 -0
- package/dist/esm/docker/lib/RegistryAuth.js +12 -0
- package/dist/esm/docker/options/DockerPruneOptions.js +43 -0
- package/dist/esm/docker/options/auth/DockerAuthOptions.js +55 -0
- package/dist/esm/docker/options/container/ContainerCommitOptions.js +35 -0
- package/dist/esm/docker/options/container/ContainerCreateTTYOptions.js +39 -0
- package/dist/esm/docker/options/container/ContainerExecOptions.js +34 -0
- package/dist/esm/docker/options/container/ContainerExportDirectoryOptions.js +35 -0
- package/dist/esm/docker/options/container/ContainerKillOptions.js +32 -0
- package/dist/esm/docker/options/container/ContainerLogsOptions.js +52 -0
- package/dist/esm/docker/options/container/ContainerRemoveOptions.js +30 -0
- package/dist/esm/docker/options/container/ContainerSettingOptions.js +132 -0
- package/dist/esm/docker/options/container/ContainerStopOptions.js +36 -0
- package/dist/esm/docker/options/container/ContainerTTYConsoleSizeOptions.js +36 -0
- package/dist/esm/docker/options/image/ImageBuildOptions.js +107 -0
- package/dist/esm/docker/options/image/ImageExportOptions.js +40 -0
- package/dist/esm/docker/options/image/ImageImportOptions.js +38 -0
- package/dist/esm/docker/options/image/ImagePullOptions.js +59 -0
- package/dist/esm/docker/options/image/ImagePushOptions.js +52 -0
- package/dist/esm/docker/options/image/ImageRemoveOptions.js +34 -0
- package/dist/esm/docker/options/image/ImageTagOptions.js +34 -0
- package/dist/esm/docker/options/network/NetworkCreateOptions.js +59 -0
- package/dist/esm/docker/types/ContainerBind.js +1 -0
- package/dist/esm/docker/types/ContainerCapability.js +287 -0
- package/dist/esm/docker/types/ContainerConfig.js +1 -0
- package/dist/esm/docker/types/ContainerDevice.js +1 -0
- package/dist/esm/docker/types/ContainerExecResult.js +1 -0
- package/dist/esm/docker/types/ContainerNetwork.js +1 -0
- package/dist/esm/docker/types/ContainerPort.js +1 -0
- package/dist/esm/docker/types/ContainerRestartPolicy.js +1 -0
- package/dist/esm/docker/types/ContainerState.js +1 -0
- package/dist/esm/docker/types/ContainerStats.js +1 -0
- package/dist/esm/docker/types/DockerOutputCallback.js +1 -0
- package/dist/esm/docker/types/ImageConfig.js +1 -0
- package/dist/esm/docker/types/ImageExposePort.js +1 -0
- package/dist/esm/docker/types/NetworkInfo.js +1 -0
- package/dist/esm/docker/types/RepositoryTag.js +1 -0
- package/dist/esm/exports/Docker.js +73 -0
- package/dist/types/client/BuildContext.d.ts +22 -0
- package/dist/types/client/BuildKitProgress.d.ts +81 -0
- package/dist/types/client/DockerClient.d.ts +196 -0
- package/dist/types/client/DockerConnection.d.ts +154 -0
- package/dist/types/client/DockerIgnore.d.ts +44 -0
- package/dist/types/client/DockerRequestError.d.ts +17 -0
- package/dist/types/client/DockerStreams.d.ts +35 -0
- package/dist/types/client/types/ContainerCreateResponse.d.ts +7 -0
- package/dist/types/client/types/ContainerStopQuery.d.ts +13 -0
- package/dist/types/client/types/DeviceMapping.d.ts +8 -0
- package/dist/types/client/types/IdResponse.d.ts +6 -0
- package/dist/types/client/types/NetworkCreateResponse.d.ts +7 -0
- package/dist/types/client/types/PortBinding.d.ts +10 -0
- package/dist/types/docker/ConnectionOptionsBuilder.d.ts +128 -0
- package/dist/types/docker/Docker.d.ts +301 -0
- package/dist/types/docker/exceptions/DockerConnectionException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerContainerNotFoundException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerImageBuildException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerImageImportException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerImageNotFoundException.d.ts +10 -0
- package/dist/types/docker/exceptions/DockerImagePullException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerImagePushException.d.ts +8 -0
- package/dist/types/docker/exceptions/DockerImageRepoTagNotFoundException.d.ts +8 -0
- package/dist/types/docker/exceptions/DockerNetworkNotFoundException.d.ts +9 -0
- package/dist/types/docker/exceptions/DockerRequestException.d.ts +22 -0
- package/dist/types/docker/interfaces/IDockerConnectionOptions.d.ts +75 -0
- package/dist/types/docker/interfaces/IDockerHttpConnectionOptions.d.ts +16 -0
- package/dist/types/docker/interfaces/IDockerHttpsConnectionOptions.d.ts +16 -0
- package/dist/types/docker/interfaces/IDockerKeyObject.d.ts +14 -0
- package/dist/types/docker/interfaces/IDockerSSHConnectionOptions.d.ts +16 -0
- package/dist/types/docker/interfaces/IDockerSocketConnectionOptions.d.ts +7 -0
- package/dist/types/docker/lib/DockerContainer.d.ts +315 -0
- package/dist/types/docker/lib/DockerContainerTTY.d.ts +99 -0
- package/dist/types/docker/lib/DockerImage.d.ts +153 -0
- package/dist/types/docker/lib/EngineSettings.d.ts +41 -0
- package/dist/types/docker/lib/ParseBaseImages.d.ts +9 -0
- package/dist/types/docker/lib/ParseEnvToRecord.d.ts +14 -0
- package/dist/types/docker/lib/ParseRepositoryTag.d.ts +17 -0
- package/dist/types/docker/lib/RegistryAuth.d.ts +8 -0
- package/dist/types/docker/options/DockerPruneOptions.d.ts +38 -0
- package/dist/types/docker/options/auth/DockerAuthOptions.d.ts +46 -0
- package/dist/types/docker/options/container/ContainerCommitOptions.d.ts +28 -0
- package/dist/types/docker/options/container/ContainerCreateTTYOptions.d.ts +32 -0
- package/dist/types/docker/options/container/ContainerExecOptions.d.ts +26 -0
- package/dist/types/docker/options/container/ContainerExportDirectoryOptions.d.ts +27 -0
- package/dist/types/docker/options/container/ContainerKillOptions.d.ts +25 -0
- package/dist/types/docker/options/container/ContainerLogsOptions.d.ts +48 -0
- package/dist/types/docker/options/container/ContainerRemoveOptions.d.ts +22 -0
- package/dist/types/docker/options/container/ContainerSettingOptions.d.ts +137 -0
- package/dist/types/docker/options/container/ContainerStopOptions.d.ts +28 -0
- package/dist/types/docker/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
- package/dist/types/docker/options/image/ImageBuildOptions.d.ts +117 -0
- package/dist/types/docker/options/image/ImageExportOptions.d.ts +33 -0
- package/dist/types/docker/options/image/ImageImportOptions.d.ts +28 -0
- package/dist/types/docker/options/image/ImagePullOptions.d.ts +49 -0
- package/dist/types/docker/options/image/ImagePushOptions.d.ts +41 -0
- package/dist/types/docker/options/image/ImageRemoveOptions.d.ts +26 -0
- package/dist/types/docker/options/image/ImageTagOptions.d.ts +25 -0
- package/dist/types/docker/options/network/NetworkCreateOptions.d.ts +54 -0
- package/dist/types/docker/types/ContainerBind.d.ts +19 -0
- package/dist/types/docker/types/ContainerCapability.d.ts +286 -0
- package/dist/types/docker/types/ContainerConfig.d.ts +67 -0
- package/dist/types/docker/types/ContainerDevice.d.ts +19 -0
- package/dist/types/docker/types/ContainerExecResult.d.ts +20 -0
- package/dist/types/docker/types/ContainerNetwork.d.ts +46 -0
- package/dist/types/docker/types/ContainerPort.d.ts +25 -0
- package/dist/types/docker/types/ContainerRestartPolicy.d.ts +11 -0
- package/dist/types/docker/types/ContainerState.d.ts +48 -0
- package/dist/types/docker/types/ContainerStats.d.ts +408 -0
- package/dist/types/docker/types/DockerOutputCallback.d.ts +8 -0
- package/dist/types/docker/types/ImageConfig.d.ts +34 -0
- package/dist/types/docker/types/ImageExposePort.d.ts +17 -0
- package/dist/types/docker/types/NetworkInfo.d.ts +59 -0
- package/dist/types/docker/types/RepositoryTag.d.ts +15 -0
- package/dist/types/exports/Docker.d.ts +73 -0
- package/package.json +57 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container's resource settings, in the Docker Engine's terms. No method of the component returns or accepts it:
|
|
3
|
+
* {@link DockerContainer} exposes these settings as its own properties (`memoryLimit`, `cpuSet`, `devices`,
|
|
4
|
+
* `OOMKillDisable`, `restartPolicy`), and {@link ContainerSettingOptions} sets them.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* The memory limit, in bytes; `0` for no limit.
|
|
9
|
+
*/
|
|
10
|
+
memory: number;
|
|
11
|
+
/**
|
|
12
|
+
* The indexes of the host CPUs the container may run on (`[0, 1]`).
|
|
13
|
+
*/
|
|
14
|
+
cpus: number[];
|
|
15
|
+
/**
|
|
16
|
+
* The host devices made available in the container.
|
|
17
|
+
*/
|
|
18
|
+
devices: {
|
|
19
|
+
/**
|
|
20
|
+
* The path of the device on the host (`/dev/ttyUSB0`).
|
|
21
|
+
*/
|
|
22
|
+
hostPath: string;
|
|
23
|
+
/**
|
|
24
|
+
* The path of the device in the container.
|
|
25
|
+
*/
|
|
26
|
+
containerPath: string;
|
|
27
|
+
/**
|
|
28
|
+
* What the container's cgroup allows on the device: a combination of `r`, `w` and `m` (`"rwm"`).
|
|
29
|
+
*/
|
|
30
|
+
cgroupPermissions: string;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* `true` when the kernel's OOM killer does not kill the container's processes when it runs out of memory.
|
|
34
|
+
*/
|
|
35
|
+
OOMKillDisable: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The resource limits (ulimits) of the container's processes.
|
|
38
|
+
*/
|
|
39
|
+
ulimits: {
|
|
40
|
+
/**
|
|
41
|
+
* The limit name (`nofile`, `nproc`).
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The soft limit, which a process can raise up to the hard limit.
|
|
46
|
+
*/
|
|
47
|
+
soft: number;
|
|
48
|
+
/**
|
|
49
|
+
* The hard limit.
|
|
50
|
+
*/
|
|
51
|
+
hard: number;
|
|
52
|
+
}[];
|
|
53
|
+
/**
|
|
54
|
+
* When Docker restarts the container after it exits.
|
|
55
|
+
*/
|
|
56
|
+
restartPolicy: {
|
|
57
|
+
/**
|
|
58
|
+
* The policy: `''` or `'no'`, never; `'always'`, always; `'unless-stopped'`, always except after the container
|
|
59
|
+
* was stopped by hand; `'on-failure'`, only when it exits with a non-zero code.
|
|
60
|
+
*/
|
|
61
|
+
name: '' | 'no' | 'always' | 'unless-stopped' | 'on-failure';
|
|
62
|
+
/**
|
|
63
|
+
* With `'on-failure'`, the number of restarts before Docker gives up; `0` for no limit.
|
|
64
|
+
*/
|
|
65
|
+
maximumRetryCount: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A host device made available in a container (`docker run --device`). Read from the container's settings
|
|
3
|
+
* (`DockerContainer.devices`) and given to {@link ContainerSettingOptions.devices}.
|
|
4
|
+
*/
|
|
5
|
+
export type ContainerDevice = {
|
|
6
|
+
/**
|
|
7
|
+
* The path of the device on the host (`/dev/ttyUSB0`).
|
|
8
|
+
*/
|
|
9
|
+
hostPath: string;
|
|
10
|
+
/**
|
|
11
|
+
* The path of the device in the container (`/dev/ttyUSB0`).
|
|
12
|
+
*/
|
|
13
|
+
containerPath: string;
|
|
14
|
+
/**
|
|
15
|
+
* What the container's cgroup allows on the device: a combination of `r` (read), `w` (write) and `m` (create
|
|
16
|
+
* device nodes with mknod), `"rwm"` for all of them.
|
|
17
|
+
*/
|
|
18
|
+
cgroupPermissions: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The result of a command run in a running container ({@link DockerContainer.exec}), the same as the containerd
|
|
3
|
+
* component's: a command exiting with a non-zero code resolves too, its code given. The outputs are decoded as UTF-8
|
|
4
|
+
* and held in memory.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerExecResult = {
|
|
7
|
+
/**
|
|
8
|
+
* The exit code of the command (`0` for a success; `126` for a command which cannot be run, `127` for one not
|
|
9
|
+
* found).
|
|
10
|
+
*/
|
|
11
|
+
exitCode: number;
|
|
12
|
+
/**
|
|
13
|
+
* Its standard output.
|
|
14
|
+
*/
|
|
15
|
+
stdout: string;
|
|
16
|
+
/**
|
|
17
|
+
* Its standard error.
|
|
18
|
+
*/
|
|
19
|
+
stderr: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A network a container is connected to, with its address on it, as Docker reports it (`DockerContainer.networks`).
|
|
3
|
+
* The addresses are empty strings while the container is not running.
|
|
4
|
+
*/
|
|
5
|
+
export type ContainerNetwork = {
|
|
6
|
+
/**
|
|
7
|
+
* The network name (`bridge`, `my-network`).
|
|
8
|
+
*/
|
|
9
|
+
networkName: string;
|
|
10
|
+
/**
|
|
11
|
+
* The network ID.
|
|
12
|
+
*/
|
|
13
|
+
networkId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The ID of the container's endpoint on the network.
|
|
16
|
+
*/
|
|
17
|
+
endpointId: string;
|
|
18
|
+
/**
|
|
19
|
+
* The container's MAC address on the network (`02:42:ac:11:00:02`).
|
|
20
|
+
*/
|
|
21
|
+
mac: string;
|
|
22
|
+
/**
|
|
23
|
+
* The container's IPv4 address on the network (`172.17.0.2`).
|
|
24
|
+
*/
|
|
25
|
+
ip: string;
|
|
26
|
+
/**
|
|
27
|
+
* The network's IPv4 gateway (`172.17.0.1`).
|
|
28
|
+
*/
|
|
29
|
+
gateway: string;
|
|
30
|
+
/**
|
|
31
|
+
* The prefix length of the IPv4 subnet (`16` for a `/16`).
|
|
32
|
+
*/
|
|
33
|
+
ipPrefixLen: number;
|
|
34
|
+
/**
|
|
35
|
+
* The container's global IPv6 address on the network, an empty string without IPv6.
|
|
36
|
+
*/
|
|
37
|
+
ipv6: string;
|
|
38
|
+
/**
|
|
39
|
+
* The network's IPv6 gateway, an empty string without IPv6.
|
|
40
|
+
*/
|
|
41
|
+
ipv6Gateway: string;
|
|
42
|
+
/**
|
|
43
|
+
* The prefix length of the IPv6 subnet.
|
|
44
|
+
*/
|
|
45
|
+
ipv6PrefixLen: number;
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container port and the host ports publishing it (`DockerContainer.ports`). The container has one entry per address
|
|
3
|
+
* it has on its networks, per port exposed by its image or published, and per protocol; the entries of a port exposed
|
|
4
|
+
* but not published have no host port. A container without an address (not running) has none.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerPort = {
|
|
7
|
+
/**
|
|
8
|
+
* The container's address on one of its networks: an IPv4 address (`172.17.0.2`), or an IPv6 address between
|
|
9
|
+
* brackets (`[fd00::2]`). It is not a host address.
|
|
10
|
+
*/
|
|
11
|
+
host: string;
|
|
12
|
+
/**
|
|
13
|
+
* The port in the container (`8080`).
|
|
14
|
+
*/
|
|
15
|
+
port: number;
|
|
16
|
+
/**
|
|
17
|
+
* The protocol of the port.
|
|
18
|
+
*/
|
|
19
|
+
type: 'tcp' | 'udp';
|
|
20
|
+
/**
|
|
21
|
+
* The host ports publishing it, each one once (Docker binds a port on the host's IPv4 and IPv6 addresses); empty
|
|
22
|
+
* when it is not published.
|
|
23
|
+
*/
|
|
24
|
+
hostPorts: number[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When Docker restarts a container after it exits:
|
|
3
|
+
* - `''`: never (no policy, the same as `'no'`);
|
|
4
|
+
* - `'no'`: never;
|
|
5
|
+
* - `'always'`: always, and when the Docker daemon starts, even if the container was stopped by hand;
|
|
6
|
+
* - `'unless-stopped'`: always, except after the container was stopped by hand;
|
|
7
|
+
* - `'on-failure'`: only when it exits with a non-zero code, with no limit on the retries;
|
|
8
|
+
* - `'on-failure:N'` (`'on-failure:3'`): only when it exits with a non-zero code, `N` times at most (as
|
|
9
|
+
* `docker run --restart on-failure:3`).
|
|
10
|
+
*/
|
|
11
|
+
export type ContainerRestartPolicy = '' | 'no' | 'always' | 'unless-stopped' | 'on-failure' | `on-failure:${number}`;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Time } from '@lakutata/utils/Time';
|
|
2
|
+
/**
|
|
3
|
+
* A container's state, as Docker reports it when the container is read (`DockerContainer.state`, updated by its
|
|
4
|
+
* `start()`, `stop()`, `pause()`… methods).
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerState = {
|
|
7
|
+
/**
|
|
8
|
+
* The container's status: `'created'` (never started), `'running'`, `'paused'`, `'restarting'`, `'removing'`,
|
|
9
|
+
* `'exited'` or `'dead'` (could not be removed).
|
|
10
|
+
*/
|
|
11
|
+
status: 'created' | 'running' | 'paused' | 'restarting' | 'removing' | 'exited' | 'dead';
|
|
12
|
+
/**
|
|
13
|
+
* `true` while the container is running, paused included.
|
|
14
|
+
*/
|
|
15
|
+
running: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* `true` while the container is paused.
|
|
18
|
+
*/
|
|
19
|
+
paused: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* `true` while Docker restarts the container after its exit.
|
|
22
|
+
*/
|
|
23
|
+
restarting: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* `true` when the kernel's OOM killer killed one of its processes, for lack of memory.
|
|
26
|
+
*/
|
|
27
|
+
OOMKilled: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* `true` when the container is dead: Docker failed to remove it.
|
|
30
|
+
*/
|
|
31
|
+
dead: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The host process ID of the container's main process, `0` when it is not running.
|
|
34
|
+
*/
|
|
35
|
+
pid: number;
|
|
36
|
+
/**
|
|
37
|
+
* The exit code of the container's last run, `0` when it has not exited.
|
|
38
|
+
*/
|
|
39
|
+
exitCode: number;
|
|
40
|
+
/**
|
|
41
|
+
* When the container was last started; `null` when it was never started.
|
|
42
|
+
*/
|
|
43
|
+
startedAt: Time | null;
|
|
44
|
+
/**
|
|
45
|
+
* When the container last exited; `null` when it never exited.
|
|
46
|
+
*/
|
|
47
|
+
finishedAt: Time | null;
|
|
48
|
+
};
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Windows container's disk I/O counters ({@link ContainerStats.storage_stats}).
|
|
3
|
+
*/
|
|
4
|
+
export type ContainerStorageStats = {
|
|
5
|
+
/**
|
|
6
|
+
* The number of read operations.
|
|
7
|
+
*/
|
|
8
|
+
read_count_normalized?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The bytes read.
|
|
11
|
+
*/
|
|
12
|
+
read_size_bytes?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The number of write operations.
|
|
15
|
+
*/
|
|
16
|
+
write_count_normalized?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The bytes written.
|
|
19
|
+
*/
|
|
20
|
+
write_size_bytes?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A container's network counters, by the name of its network interface in the container (`eth0`), counted since the
|
|
24
|
+
* interface was created ({@link ContainerStats.networks}).
|
|
25
|
+
*/
|
|
26
|
+
export type ContainerNetworkStats = {
|
|
27
|
+
[name: string]: {
|
|
28
|
+
/**
|
|
29
|
+
* The bytes received.
|
|
30
|
+
*/
|
|
31
|
+
rx_bytes: number;
|
|
32
|
+
/**
|
|
33
|
+
* The received packets dropped.
|
|
34
|
+
*/
|
|
35
|
+
rx_dropped: number;
|
|
36
|
+
/**
|
|
37
|
+
* The receive errors.
|
|
38
|
+
*/
|
|
39
|
+
rx_errors: number;
|
|
40
|
+
/**
|
|
41
|
+
* The packets received.
|
|
42
|
+
*/
|
|
43
|
+
rx_packets: number;
|
|
44
|
+
/**
|
|
45
|
+
* The bytes sent.
|
|
46
|
+
*/
|
|
47
|
+
tx_bytes: number;
|
|
48
|
+
/**
|
|
49
|
+
* The packets dropped while sending.
|
|
50
|
+
*/
|
|
51
|
+
tx_dropped: number;
|
|
52
|
+
/**
|
|
53
|
+
* The send errors.
|
|
54
|
+
*/
|
|
55
|
+
tx_errors: number;
|
|
56
|
+
/**
|
|
57
|
+
* The packets sent.
|
|
58
|
+
*/
|
|
59
|
+
tx_packets: number;
|
|
60
|
+
/**
|
|
61
|
+
* The endpoint ID, on Windows only.
|
|
62
|
+
*/
|
|
63
|
+
endpoint_id?: string;
|
|
64
|
+
/**
|
|
65
|
+
* The instance ID, on Windows only.
|
|
66
|
+
*/
|
|
67
|
+
instance_id?: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* A container's memory use ({@link ContainerStats.memory_stats}). The Linux fields are the ones of cgroup v1: on a host
|
|
72
|
+
* using cgroup v2 (most current distributions), `max_usage` and `failcnt` are absent, and `stats` holds the cgroup v2
|
|
73
|
+
* counters (`anon`, `file`, `inactive_file`…) instead of the ones listed here.
|
|
74
|
+
*/
|
|
75
|
+
export type ContainerMemoryStats = {
|
|
76
|
+
/**
|
|
77
|
+
* The cgroup's memory counters (its `memory.stat` file): the sizes in bytes, the page fault and page in/out counters
|
|
78
|
+
* in events; the `total_` fields include the child cgroups.
|
|
79
|
+
*/
|
|
80
|
+
stats: {
|
|
81
|
+
/**
|
|
82
|
+
* The major page faults, child cgroups included.
|
|
83
|
+
*/
|
|
84
|
+
total_pgmajfault: number;
|
|
85
|
+
/**
|
|
86
|
+
* The page cache, in bytes.
|
|
87
|
+
*/
|
|
88
|
+
cache: number;
|
|
89
|
+
/**
|
|
90
|
+
* The memory-mapped files, in bytes.
|
|
91
|
+
*/
|
|
92
|
+
mapped_file: number;
|
|
93
|
+
/**
|
|
94
|
+
* The inactive file-backed memory, in bytes, child cgroups included.
|
|
95
|
+
*/
|
|
96
|
+
total_inactive_file: number;
|
|
97
|
+
/**
|
|
98
|
+
* The pages paged out.
|
|
99
|
+
*/
|
|
100
|
+
pgpgout: number;
|
|
101
|
+
/**
|
|
102
|
+
* The anonymous memory and swap cache (RSS), in bytes.
|
|
103
|
+
*/
|
|
104
|
+
rss: number;
|
|
105
|
+
/**
|
|
106
|
+
* The memory-mapped files, in bytes, child cgroups included.
|
|
107
|
+
*/
|
|
108
|
+
total_mapped_file: number;
|
|
109
|
+
/**
|
|
110
|
+
* The file pages being written back to disk, in bytes.
|
|
111
|
+
*/
|
|
112
|
+
writeback: number;
|
|
113
|
+
/**
|
|
114
|
+
* The memory which cannot be reclaimed (locked), in bytes.
|
|
115
|
+
*/
|
|
116
|
+
unevictable: number;
|
|
117
|
+
/**
|
|
118
|
+
* The pages paged in.
|
|
119
|
+
*/
|
|
120
|
+
pgpgin: number;
|
|
121
|
+
/**
|
|
122
|
+
* The memory which cannot be reclaimed, in bytes, child cgroups included.
|
|
123
|
+
*/
|
|
124
|
+
total_unevictable: number;
|
|
125
|
+
/**
|
|
126
|
+
* The major page faults.
|
|
127
|
+
*/
|
|
128
|
+
pgmajfault: number;
|
|
129
|
+
/**
|
|
130
|
+
* The RSS, in bytes, child cgroups included.
|
|
131
|
+
*/
|
|
132
|
+
total_rss: number;
|
|
133
|
+
/**
|
|
134
|
+
* The anonymous transparent huge pages, in bytes, child cgroups included.
|
|
135
|
+
*/
|
|
136
|
+
total_rss_huge: number;
|
|
137
|
+
/**
|
|
138
|
+
* The file pages being written back to disk, in bytes, child cgroups included.
|
|
139
|
+
*/
|
|
140
|
+
total_writeback: number;
|
|
141
|
+
/**
|
|
142
|
+
* The inactive anonymous memory, in bytes, child cgroups included.
|
|
143
|
+
*/
|
|
144
|
+
total_inactive_anon: number;
|
|
145
|
+
/**
|
|
146
|
+
* The anonymous transparent huge pages, in bytes.
|
|
147
|
+
*/
|
|
148
|
+
rss_huge: number;
|
|
149
|
+
/**
|
|
150
|
+
* The memory limit of the cgroup hierarchy, in bytes.
|
|
151
|
+
*/
|
|
152
|
+
hierarchical_memory_limit: number;
|
|
153
|
+
/**
|
|
154
|
+
* The page faults, child cgroups included.
|
|
155
|
+
*/
|
|
156
|
+
total_pgfault: number;
|
|
157
|
+
/**
|
|
158
|
+
* The active file-backed memory, in bytes, child cgroups included.
|
|
159
|
+
*/
|
|
160
|
+
total_active_file: number;
|
|
161
|
+
/**
|
|
162
|
+
* The active anonymous memory, in bytes.
|
|
163
|
+
*/
|
|
164
|
+
active_anon: number;
|
|
165
|
+
/**
|
|
166
|
+
* The active anonymous memory, in bytes, child cgroups included.
|
|
167
|
+
*/
|
|
168
|
+
total_active_anon: number;
|
|
169
|
+
/**
|
|
170
|
+
* The pages paged out, child cgroups included.
|
|
171
|
+
*/
|
|
172
|
+
total_pgpgout: number;
|
|
173
|
+
/**
|
|
174
|
+
* The page cache, in bytes, child cgroups included.
|
|
175
|
+
*/
|
|
176
|
+
total_cache: number;
|
|
177
|
+
/**
|
|
178
|
+
* The inactive anonymous memory, in bytes.
|
|
179
|
+
*/
|
|
180
|
+
inactive_anon: number;
|
|
181
|
+
/**
|
|
182
|
+
* The active file-backed memory, in bytes.
|
|
183
|
+
*/
|
|
184
|
+
active_file: number;
|
|
185
|
+
/**
|
|
186
|
+
* The page faults.
|
|
187
|
+
*/
|
|
188
|
+
pgfault: number;
|
|
189
|
+
/**
|
|
190
|
+
* The inactive file-backed memory, in bytes.
|
|
191
|
+
*/
|
|
192
|
+
inactive_file: number;
|
|
193
|
+
/**
|
|
194
|
+
* The pages paged in, child cgroups included.
|
|
195
|
+
*/
|
|
196
|
+
total_pgpgin: number;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* The highest memory use recorded, in bytes (cgroup v1 only).
|
|
200
|
+
*/
|
|
201
|
+
max_usage: number;
|
|
202
|
+
/**
|
|
203
|
+
* The current memory use, in bytes, page cache included (`docker stats` subtracts the inactive files from it).
|
|
204
|
+
*/
|
|
205
|
+
usage: number;
|
|
206
|
+
/**
|
|
207
|
+
* The number of times the memory use hit the limit (cgroup v1 only).
|
|
208
|
+
*/
|
|
209
|
+
failcnt: number;
|
|
210
|
+
/**
|
|
211
|
+
* The memory limit, in bytes: the host memory when the container has no limit.
|
|
212
|
+
*/
|
|
213
|
+
limit: number;
|
|
214
|
+
/**
|
|
215
|
+
* The committed memory, in bytes (Windows only).
|
|
216
|
+
*/
|
|
217
|
+
commitbytes?: number;
|
|
218
|
+
/**
|
|
219
|
+
* The highest committed memory, in bytes (Windows only).
|
|
220
|
+
*/
|
|
221
|
+
commitpeakbytes?: number;
|
|
222
|
+
/**
|
|
223
|
+
* The private working set, in bytes (Windows only).
|
|
224
|
+
*/
|
|
225
|
+
privateworkingset?: number;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* A container's cumulated CPU time ({@link ContainerCPUStats.cpu_usage}), in nanoseconds on Linux and in 100-nanosecond
|
|
229
|
+
* units on Windows.
|
|
230
|
+
*/
|
|
231
|
+
export type ContainerCPUUsage = {
|
|
232
|
+
/**
|
|
233
|
+
* The CPU time per host CPU (cgroup v1 only: absent on a host using cgroup v2).
|
|
234
|
+
*/
|
|
235
|
+
percpu_usage: number[];
|
|
236
|
+
/**
|
|
237
|
+
* The CPU time spent in user mode.
|
|
238
|
+
*/
|
|
239
|
+
usage_in_usermode: number;
|
|
240
|
+
/**
|
|
241
|
+
* The total CPU time.
|
|
242
|
+
*/
|
|
243
|
+
total_usage: number;
|
|
244
|
+
/**
|
|
245
|
+
* The CPU time spent in kernel mode.
|
|
246
|
+
*/
|
|
247
|
+
usage_in_kernelmode: number;
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* How a container with a CPU limit was throttled ({@link ContainerCPUStats.throttling_data}), since it started.
|
|
251
|
+
*/
|
|
252
|
+
export type ContainerThrottlingData = {
|
|
253
|
+
/**
|
|
254
|
+
* The number of enforcement periods elapsed.
|
|
255
|
+
*/
|
|
256
|
+
periods: number;
|
|
257
|
+
/**
|
|
258
|
+
* The number of periods in which the container was throttled.
|
|
259
|
+
*/
|
|
260
|
+
throttled_periods: number;
|
|
261
|
+
/**
|
|
262
|
+
* The total time the container was throttled, in nanoseconds.
|
|
263
|
+
*/
|
|
264
|
+
throttled_time: number;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* A container's CPU use at one moment ({@link ContainerStats.cpu_stats}). The CPU percentage of `docker stats` is the
|
|
268
|
+
* growth of `cpu_usage.total_usage` divided by the growth of `system_cpu_usage` between two readings, multiplied by
|
|
269
|
+
* `online_cpus` and 100.
|
|
270
|
+
*/
|
|
271
|
+
export type ContainerCPUStats = {
|
|
272
|
+
/**
|
|
273
|
+
* The container's cumulated CPU time.
|
|
274
|
+
*/
|
|
275
|
+
cpu_usage: ContainerCPUUsage;
|
|
276
|
+
/**
|
|
277
|
+
* The host's cumulated CPU time, all CPUs added, in nanoseconds (Linux only).
|
|
278
|
+
*/
|
|
279
|
+
system_cpu_usage: number;
|
|
280
|
+
/**
|
|
281
|
+
* The number of host CPUs online.
|
|
282
|
+
*/
|
|
283
|
+
online_cpus: number;
|
|
284
|
+
/**
|
|
285
|
+
* How the container was throttled by its CPU limit.
|
|
286
|
+
*/
|
|
287
|
+
throttling_data: ContainerThrottlingData;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* A block I/O counter of one device ({@link ContainerBlkioStats}).
|
|
291
|
+
*/
|
|
292
|
+
export type ContainerBlkioStatEntry = {
|
|
293
|
+
/**
|
|
294
|
+
* The device's major number.
|
|
295
|
+
*/
|
|
296
|
+
major: number;
|
|
297
|
+
/**
|
|
298
|
+
* The device's minor number.
|
|
299
|
+
*/
|
|
300
|
+
minor: number;
|
|
301
|
+
/**
|
|
302
|
+
* The operation counted: `read`, `write` (`Read`, `Write`, `Sync`, `Async`, `Discard`, `Total` on cgroup v1).
|
|
303
|
+
*/
|
|
304
|
+
op: string;
|
|
305
|
+
/**
|
|
306
|
+
* The counter's value, in the unit of its list.
|
|
307
|
+
*/
|
|
308
|
+
value: number;
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* A Linux container's block I/O counters, by device and operation ({@link ContainerStats.blkio_stats}). On a host using
|
|
312
|
+
* cgroup v2, only `io_service_bytes_recursive` and `io_serviced_recursive` are filled: Docker reports `null` for the
|
|
313
|
+
* other lists.
|
|
314
|
+
*/
|
|
315
|
+
export type ContainerBlkioStats = {
|
|
316
|
+
/**
|
|
317
|
+
* The bytes transferred.
|
|
318
|
+
*/
|
|
319
|
+
io_service_bytes_recursive: ContainerBlkioStatEntry[];
|
|
320
|
+
/**
|
|
321
|
+
* The number of I/O operations.
|
|
322
|
+
*/
|
|
323
|
+
io_serviced_recursive: ContainerBlkioStatEntry[];
|
|
324
|
+
/**
|
|
325
|
+
* The number of I/O operations queued (cgroup v1 only).
|
|
326
|
+
*/
|
|
327
|
+
io_queue_recursive: ContainerBlkioStatEntry[];
|
|
328
|
+
/**
|
|
329
|
+
* The time spent servicing the I/O operations, in nanoseconds (cgroup v1 only).
|
|
330
|
+
*/
|
|
331
|
+
io_service_time_recursive: ContainerBlkioStatEntry[];
|
|
332
|
+
/**
|
|
333
|
+
* The time the I/O operations waited in the queues, in nanoseconds (cgroup v1 only).
|
|
334
|
+
*/
|
|
335
|
+
io_wait_time_recursive: ContainerBlkioStatEntry[];
|
|
336
|
+
/**
|
|
337
|
+
* The number of I/O operations merged into others (cgroup v1 only).
|
|
338
|
+
*/
|
|
339
|
+
io_merged_recursive: ContainerBlkioStatEntry[];
|
|
340
|
+
/**
|
|
341
|
+
* The disk time allocated to the container, in milliseconds (cgroup v1 only).
|
|
342
|
+
*/
|
|
343
|
+
io_time_recursive: ContainerBlkioStatEntry[];
|
|
344
|
+
/**
|
|
345
|
+
* The sectors transferred (cgroup v1 only).
|
|
346
|
+
*/
|
|
347
|
+
sectors_recursive: ContainerBlkioStatEntry[];
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* The processes of a Linux container ({@link ContainerStats.pids_stats}).
|
|
351
|
+
*/
|
|
352
|
+
export type ContainerPidsStats = {
|
|
353
|
+
/**
|
|
354
|
+
* The number of processes and threads in the container.
|
|
355
|
+
*/
|
|
356
|
+
current?: number;
|
|
357
|
+
/**
|
|
358
|
+
* The maximum number of processes and threads (`docker run --pids-limit`); absent, or `0`, without a limit.
|
|
359
|
+
*/
|
|
360
|
+
limit?: number;
|
|
361
|
+
};
|
|
362
|
+
/**
|
|
363
|
+
* A container's resource use at one moment, as the Docker Engine reports it (`GET /containers/{id}/stats`), returned by
|
|
364
|
+
* `DockerContainer.stats()`. The statistics are read once, without waiting for a second sample: `precpu_stats` is
|
|
365
|
+
* empty (its counters `0`) and `preread` is the zero date, so a CPU percentage needs two calls, compared.
|
|
366
|
+
*/
|
|
367
|
+
export type ContainerStats = {
|
|
368
|
+
/**
|
|
369
|
+
* When the statistics were read, an RFC 3339 date with nanoseconds (`2026-10-04T08:15:30.123456789Z`).
|
|
370
|
+
*/
|
|
371
|
+
read: string;
|
|
372
|
+
/**
|
|
373
|
+
* When the previous statistics were read: the zero date (`0001-01-01T00:00:00Z`), as they are read once.
|
|
374
|
+
*/
|
|
375
|
+
preread: string;
|
|
376
|
+
/**
|
|
377
|
+
* The container's processes (Linux only).
|
|
378
|
+
*/
|
|
379
|
+
pids_stats?: ContainerPidsStats;
|
|
380
|
+
/**
|
|
381
|
+
* The container's block I/O (Linux only).
|
|
382
|
+
*/
|
|
383
|
+
blkio_stats?: ContainerBlkioStats;
|
|
384
|
+
/**
|
|
385
|
+
* The number of processes (Windows only: `0` on Linux).
|
|
386
|
+
*/
|
|
387
|
+
num_procs: number;
|
|
388
|
+
/**
|
|
389
|
+
* The container's disk I/O (Windows only).
|
|
390
|
+
*/
|
|
391
|
+
storage_stats?: ContainerStorageStats;
|
|
392
|
+
/**
|
|
393
|
+
* The container's network counters, by interface. Docker omits them for a container without a network (`none`).
|
|
394
|
+
*/
|
|
395
|
+
networks: ContainerNetworkStats;
|
|
396
|
+
/**
|
|
397
|
+
* The container's memory use.
|
|
398
|
+
*/
|
|
399
|
+
memory_stats: ContainerMemoryStats;
|
|
400
|
+
/**
|
|
401
|
+
* The container's CPU use.
|
|
402
|
+
*/
|
|
403
|
+
cpu_stats: ContainerCPUStats;
|
|
404
|
+
/**
|
|
405
|
+
* The CPU use of the previous reading: its counters are `0`, as the statistics are read once.
|
|
406
|
+
*/
|
|
407
|
+
precpu_stats: ContainerCPUStats;
|
|
408
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receive each progress message of a Docker image operation (pull, push, build), as it arrives: the JSON object sent by
|
|
3
|
+
* the Docker Engine, as `docker pull` displays it (`{status: 'Downloading', id: '<layer>', progressDetail: {current,
|
|
4
|
+
* total}}`, `{error: '…'}`), and for a build, the BuildKit progress as the lines of `docker build --progress=plain`
|
|
5
|
+
* (`{id: 'moby.buildkit.trace', stream: '#2 [1/2] FROM alpine'}`). An error in a message fails the operation once its
|
|
6
|
+
* stream ends.
|
|
7
|
+
*/
|
|
8
|
+
export type DockerOutputCallback = (output: Record<string, any>) => void;
|