@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,73 @@
|
|
|
1
|
+
export * from '../docker/Docker.js';
|
|
2
|
+
export * from '../docker/ConnectionOptionsBuilder.js';
|
|
3
|
+
/**
|
|
4
|
+
* Lib
|
|
5
|
+
*/
|
|
6
|
+
export * from '../docker/lib/DockerContainer.js';
|
|
7
|
+
export * from '../docker/lib/DockerContainerTTY.js';
|
|
8
|
+
export * from '../docker/lib/DockerImage.js';
|
|
9
|
+
export * from '../docker/lib/ParseEnvToRecord.js';
|
|
10
|
+
export * from '../docker/lib/ParseRepositoryTag.js';
|
|
11
|
+
/**
|
|
12
|
+
* Interfaces
|
|
13
|
+
*/
|
|
14
|
+
export * from '../docker/interfaces/IDockerConnectionOptions.js';
|
|
15
|
+
export * from '../docker/interfaces/IDockerHttpConnectionOptions.js';
|
|
16
|
+
export * from '../docker/interfaces/IDockerHttpsConnectionOptions.js';
|
|
17
|
+
export * from '../docker/interfaces/IDockerKeyObject.js';
|
|
18
|
+
export * from '../docker/interfaces/IDockerSocketConnectionOptions.js';
|
|
19
|
+
export * from '../docker/interfaces/IDockerSSHConnectionOptions.js';
|
|
20
|
+
/**
|
|
21
|
+
* Types
|
|
22
|
+
*/
|
|
23
|
+
export * from '../docker/types/ContainerBind.js';
|
|
24
|
+
export * from '../docker/types/RepositoryTag.js';
|
|
25
|
+
export * from '../docker/types/ContainerCapability.js';
|
|
26
|
+
export * from '../docker/types/ContainerConfig.js';
|
|
27
|
+
export * from '../docker/types/ContainerDevice.js';
|
|
28
|
+
export * from '../docker/types/ContainerExecResult.js';
|
|
29
|
+
export * from '../docker/types/ContainerNetwork.js';
|
|
30
|
+
export * from '../docker/types/ContainerPort.js';
|
|
31
|
+
export * from '../docker/types/ContainerRestartPolicy.js';
|
|
32
|
+
export * from '../docker/types/ContainerState.js';
|
|
33
|
+
export * from '../docker/types/ContainerStats.js';
|
|
34
|
+
export * from '../docker/types/DockerOutputCallback.js';
|
|
35
|
+
export * from '../docker/types/ImageConfig.js';
|
|
36
|
+
export * from '../docker/types/ImageExposePort.js';
|
|
37
|
+
export * from '../docker/types/NetworkInfo.js';
|
|
38
|
+
/**
|
|
39
|
+
* Options
|
|
40
|
+
*/
|
|
41
|
+
export * from '../docker/options/DockerPruneOptions.js';
|
|
42
|
+
export * from '../docker/options/auth/DockerAuthOptions.js';
|
|
43
|
+
export * from '../docker/options/container/ContainerCommitOptions.js';
|
|
44
|
+
export * from '../docker/options/container/ContainerCreateTTYOptions.js';
|
|
45
|
+
export * from '../docker/options/container/ContainerExecOptions.js';
|
|
46
|
+
export * from '../docker/options/container/ContainerKillOptions.js';
|
|
47
|
+
export * from '../docker/options/container/ContainerExportDirectoryOptions.js';
|
|
48
|
+
export * from '../docker/options/container/ContainerLogsOptions.js';
|
|
49
|
+
export * from '../docker/options/container/ContainerRemoveOptions.js';
|
|
50
|
+
export * from '../docker/options/container/ContainerSettingOptions.js';
|
|
51
|
+
export * from '../docker/options/container/ContainerStopOptions.js';
|
|
52
|
+
export * from '../docker/options/container/ContainerTTYConsoleSizeOptions.js';
|
|
53
|
+
export * from '../docker/options/image/ImageBuildOptions.js';
|
|
54
|
+
export * from '../docker/options/image/ImageExportOptions.js';
|
|
55
|
+
export * from '../docker/options/image/ImageImportOptions.js';
|
|
56
|
+
export * from '../docker/options/image/ImagePullOptions.js';
|
|
57
|
+
export * from '../docker/options/image/ImagePushOptions.js';
|
|
58
|
+
export * from '../docker/options/image/ImageRemoveOptions.js';
|
|
59
|
+
export * from '../docker/options/image/ImageTagOptions.js';
|
|
60
|
+
export * from '../docker/options/network/NetworkCreateOptions.js';
|
|
61
|
+
/**
|
|
62
|
+
* Exceptions
|
|
63
|
+
*/
|
|
64
|
+
export * from '../docker/exceptions/DockerConnectionException.js';
|
|
65
|
+
export * from '../docker/exceptions/DockerContainerNotFoundException.js';
|
|
66
|
+
export * from '../docker/exceptions/DockerImageBuildException.js';
|
|
67
|
+
export * from '../docker/exceptions/DockerImageImportException.js';
|
|
68
|
+
export * from '../docker/exceptions/DockerImageNotFoundException.js';
|
|
69
|
+
export * from '../docker/exceptions/DockerImagePullException.js';
|
|
70
|
+
export * from '../docker/exceptions/DockerImagePushException.js';
|
|
71
|
+
export * from '../docker/exceptions/DockerImageRepoTagNotFoundException.js';
|
|
72
|
+
export * from '../docker/exceptions/DockerNetworkNotFoundException.js';
|
|
73
|
+
export * from '../docker/exceptions/DockerRequestException.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Gzip } from 'node:zlib';
|
|
2
|
+
export type BuildContextOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* The directory of the context
|
|
5
|
+
*/
|
|
6
|
+
directory: string;
|
|
7
|
+
/**
|
|
8
|
+
* The files and the directories packed (their paths relative to the directory): the directories are packed with
|
|
9
|
+
* their content
|
|
10
|
+
*/
|
|
11
|
+
entries: string[];
|
|
12
|
+
/**
|
|
13
|
+
* The files packed even when .dockerignore excludes them (the Dockerfile, as the docker command does)
|
|
14
|
+
*/
|
|
15
|
+
always?: string[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Pack the context of a build: a gzipped tar stream; the files excluded by the .dockerignore of the directory are
|
|
19
|
+
* skipped. An error of the packing (a file which cannot be read, or changes while it is read) is an error of the stream
|
|
20
|
+
* @param options
|
|
21
|
+
*/
|
|
22
|
+
export declare function packBuildContext(options: BuildContextOptions): Gzip;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The progress of the builds of BuildKit: the "aux" of the messages "moby.buildkit.trace" of a build is a StatusResponse
|
|
3
|
+
* of BuildKit (github.com/moby/buildkit, api/services/control/control.proto), encoded by protobuf then base64. Only the
|
|
4
|
+
* fields read are decoded, by their numbers in control.proto:
|
|
5
|
+
*
|
|
6
|
+
* StatusResponse: 1 vertexes (Vertex), 2 statuses (VertexStatus), 3 logs (VertexLog), 4 warnings (VertexWarning)
|
|
7
|
+
* Vertex: 1 digest, 3 name, 4 cached, 5 started (Timestamp), 6 completed (Timestamp), 7 error
|
|
8
|
+
* VertexStatus: 1 ID, 2 vertex, 3 name, 4 current, 5 total, 8 completed (Timestamp)
|
|
9
|
+
* VertexLog: 1 vertex, 3 stream, 4 msg
|
|
10
|
+
* VertexWarning: 1 vertex, 2 level, 3 short
|
|
11
|
+
* Timestamp (google.protobuf): 1 seconds, 2 nanos
|
|
12
|
+
*/
|
|
13
|
+
export type BuildKitVertex = {
|
|
14
|
+
digest: string;
|
|
15
|
+
name: string;
|
|
16
|
+
cached: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The start and the end of the step, in milliseconds since the epoch
|
|
19
|
+
*/
|
|
20
|
+
started?: number;
|
|
21
|
+
completed?: number;
|
|
22
|
+
error?: string;
|
|
23
|
+
};
|
|
24
|
+
export type BuildKitVertexStatus = {
|
|
25
|
+
id: string;
|
|
26
|
+
vertex: string;
|
|
27
|
+
name: string;
|
|
28
|
+
current: number;
|
|
29
|
+
total: number;
|
|
30
|
+
completed?: number;
|
|
31
|
+
};
|
|
32
|
+
export type BuildKitVertexLog = {
|
|
33
|
+
vertex: string;
|
|
34
|
+
/**
|
|
35
|
+
* 1 stdout, 2 stderr
|
|
36
|
+
*/
|
|
37
|
+
stream: number;
|
|
38
|
+
message: Buffer;
|
|
39
|
+
};
|
|
40
|
+
export type BuildKitVertexWarning = {
|
|
41
|
+
vertex: string;
|
|
42
|
+
level: number;
|
|
43
|
+
short: string;
|
|
44
|
+
};
|
|
45
|
+
export type BuildKitStatus = {
|
|
46
|
+
vertexes: BuildKitVertex[];
|
|
47
|
+
statuses: BuildKitVertexStatus[];
|
|
48
|
+
logs: BuildKitVertexLog[];
|
|
49
|
+
warnings: BuildKitVertexWarning[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Decode the progress of a build: the "aux" of a message "moby.buildkit.trace"
|
|
53
|
+
* @param aux the base64 of a StatusResponse
|
|
54
|
+
*/
|
|
55
|
+
export declare function decodeBuildKitStatus(aux: string): BuildKitStatus;
|
|
56
|
+
/**
|
|
57
|
+
* The lines of the progress of a build, as "docker build --progress=plain" shows them: the steps are numbered in their
|
|
58
|
+
* order ("#3 [2/2] RUN npm ci"), with their output, and whether they are cached, done ("#3 DONE 1.2s") or failed
|
|
59
|
+
*/
|
|
60
|
+
export declare class BuildKitProgress {
|
|
61
|
+
#private;
|
|
62
|
+
/**
|
|
63
|
+
* The number of a step, given when it is first seen
|
|
64
|
+
* @param digest
|
|
65
|
+
*/
|
|
66
|
+
protected step(digest: string): {
|
|
67
|
+
number: number;
|
|
68
|
+
started: boolean;
|
|
69
|
+
ended: boolean;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The lines of a status of the build
|
|
73
|
+
* @param status
|
|
74
|
+
*/
|
|
75
|
+
lines(status: BuildKitStatus): string[];
|
|
76
|
+
/**
|
|
77
|
+
* The incomplete last line of the output of a step
|
|
78
|
+
* @param digest
|
|
79
|
+
*/
|
|
80
|
+
protected flush(digest: string): string[];
|
|
81
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { IncomingMessage } from 'node:http';
|
|
2
|
+
import type { Duplex } from 'node:stream';
|
|
3
|
+
import { DockerConnection, type DockerConnectionOptions } from './DockerConnection.js';
|
|
4
|
+
import { type ContainerCreateResponse } from './types/ContainerCreateResponse.js';
|
|
5
|
+
import { type ContainerStopQuery } from './types/ContainerStopQuery.js';
|
|
6
|
+
import { type IdResponse } from './types/IdResponse.js';
|
|
7
|
+
import { type NetworkCreateResponse } from './types/NetworkCreateResponse.js';
|
|
8
|
+
import { type RepositoryTag } from '../docker/types/RepositoryTag.js';
|
|
9
|
+
/**
|
|
10
|
+
* The exception of a request the daemon refused: the not found exception of the resource missing (told by the daemon's
|
|
11
|
+
* message, else by the meaning of the status for the request), a DockerRequestException otherwise. The other errors
|
|
12
|
+
* (the network errors, the aborts) are given as they are
|
|
13
|
+
* @param error
|
|
14
|
+
*/
|
|
15
|
+
export declare function dockerException(error: unknown): unknown;
|
|
16
|
+
/**
|
|
17
|
+
* The registry credentials of a request
|
|
18
|
+
*/
|
|
19
|
+
export type DockerRegistryAuth = {
|
|
20
|
+
username?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
serveraddress?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
identitytoken?: string;
|
|
25
|
+
registrytoken?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The client of the Docker Engine API
|
|
29
|
+
*/
|
|
30
|
+
export declare class DockerClient {
|
|
31
|
+
#private;
|
|
32
|
+
readonly connection: DockerConnection;
|
|
33
|
+
constructor(options?: DockerConnectionOptions);
|
|
34
|
+
/**
|
|
35
|
+
* Whether the daemon answers
|
|
36
|
+
* @param signal
|
|
37
|
+
*/
|
|
38
|
+
ping(signal?: AbortSignal): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* The versions of the daemon
|
|
41
|
+
*/
|
|
42
|
+
version(): Promise<Record<string, any>>;
|
|
43
|
+
/**
|
|
44
|
+
* Check registry credentials (docker login)
|
|
45
|
+
* @param auth
|
|
46
|
+
*/
|
|
47
|
+
checkAuth(auth: DockerRegistryAuth): Promise<Record<string, any>>;
|
|
48
|
+
/** Images **/
|
|
49
|
+
listImages(query?: Record<string, unknown>, signal?: AbortSignal): Promise<Record<string, any>[]>;
|
|
50
|
+
inspectImage(name: string, signal?: AbortSignal): Promise<Record<string, any>>;
|
|
51
|
+
/**
|
|
52
|
+
* Pull an image: the stream of the progress (docker pull)
|
|
53
|
+
* @param query fromImage, tag, platform
|
|
54
|
+
* @param auth
|
|
55
|
+
* @param signal
|
|
56
|
+
*/
|
|
57
|
+
pullImage(query: Record<string, unknown>, auth?: DockerRegistryAuth, signal?: AbortSignal): Promise<IncomingMessage>;
|
|
58
|
+
/**
|
|
59
|
+
* Build an image: the stream of the progress
|
|
60
|
+
* @param context the gzipped tar archive of the context
|
|
61
|
+
* @param query dockerfile, t, platform, version...
|
|
62
|
+
* @param registryConfig the credentials of the registries, by server
|
|
63
|
+
* @param signal
|
|
64
|
+
*/
|
|
65
|
+
buildImage(context: NodeJS.ReadableStream, query: Record<string, unknown>, registryConfig?: Record<string, DockerRegistryAuth>, signal?: AbortSignal): Promise<IncomingMessage>;
|
|
66
|
+
/**
|
|
67
|
+
* Load the images of a tar archive (docker load): the stream of the progress
|
|
68
|
+
* @param archive
|
|
69
|
+
* @param query quiet
|
|
70
|
+
*/
|
|
71
|
+
loadImage(archive: NodeJS.ReadableStream, query?: Record<string, unknown>): Promise<IncomingMessage>;
|
|
72
|
+
/**
|
|
73
|
+
* The tar archive of an image (docker save)
|
|
74
|
+
* @param name
|
|
75
|
+
*/
|
|
76
|
+
exportImage(name: string): Promise<IncomingMessage>;
|
|
77
|
+
tagImage(name: string, query: RepositoryTag): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Push an image: the stream of the progress
|
|
80
|
+
* @param name
|
|
81
|
+
* @param query tag, platform
|
|
82
|
+
* @param auth
|
|
83
|
+
*/
|
|
84
|
+
pushImage(name: string, query: Record<string, unknown>, auth?: DockerRegistryAuth): Promise<IncomingMessage>;
|
|
85
|
+
removeImage(name: string, query?: {
|
|
86
|
+
force?: boolean;
|
|
87
|
+
noprune?: boolean;
|
|
88
|
+
}): Promise<Record<string, any>[]>;
|
|
89
|
+
pruneImages(query?: Record<string, unknown>): Promise<Record<string, any>>;
|
|
90
|
+
/** Containers **/
|
|
91
|
+
listContainers(query?: Record<string, unknown>, signal?: AbortSignal): Promise<Record<string, any>[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Create a container
|
|
94
|
+
* @param body its configuration
|
|
95
|
+
* @param query name, platform
|
|
96
|
+
*/
|
|
97
|
+
createContainer(body: Record<string, unknown>, query?: {
|
|
98
|
+
name?: string;
|
|
99
|
+
platform?: string;
|
|
100
|
+
}): Promise<ContainerCreateResponse>;
|
|
101
|
+
inspectContainer(id: string, signal?: AbortSignal): Promise<Record<string, any>>;
|
|
102
|
+
/**
|
|
103
|
+
* Start a container: one already started is done (HTTP 304), as the Docker CLI does
|
|
104
|
+
* @param id
|
|
105
|
+
* @param signal
|
|
106
|
+
*/
|
|
107
|
+
startContainer(id: string, signal?: AbortSignal): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Stop a container: one already stopped is done (HTTP 304), as the Docker CLI does
|
|
110
|
+
* @param id
|
|
111
|
+
* @param query
|
|
112
|
+
* @param signal
|
|
113
|
+
*/
|
|
114
|
+
stopContainer(id: string, query?: ContainerStopQuery, signal?: AbortSignal): Promise<void>;
|
|
115
|
+
restartContainer(id: string, query?: ContainerStopQuery, signal?: AbortSignal): Promise<void>;
|
|
116
|
+
pauseContainer(id: string): Promise<void>;
|
|
117
|
+
unpauseContainer(id: string): Promise<void>;
|
|
118
|
+
killContainer(id: string, query?: {
|
|
119
|
+
signal?: string;
|
|
120
|
+
}): Promise<void>;
|
|
121
|
+
removeContainer(id: string, query?: {
|
|
122
|
+
v?: boolean;
|
|
123
|
+
force?: boolean;
|
|
124
|
+
link?: boolean;
|
|
125
|
+
}): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Rename a container
|
|
128
|
+
* @param id
|
|
129
|
+
* @param name
|
|
130
|
+
*/
|
|
131
|
+
renameContainer(id: string, name: string): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Update the resources and the restart policy of a container, live (docker update)
|
|
134
|
+
* @param id
|
|
135
|
+
* @param body
|
|
136
|
+
*/
|
|
137
|
+
updateContainer(id: string, body: Record<string, unknown>): Promise<Record<string, any>>;
|
|
138
|
+
/**
|
|
139
|
+
* Create an image of a container (docker commit)
|
|
140
|
+
* @param id
|
|
141
|
+
* @param query repo, tag, comment, author, pause, changes
|
|
142
|
+
*/
|
|
143
|
+
commitContainer(id: string, query?: Record<string, unknown>): Promise<IdResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* The logs of a container: multiplexed when it has no TTY
|
|
146
|
+
* @param id
|
|
147
|
+
* @param query follow, stdout, stderr, since, until, timestamps, tail
|
|
148
|
+
*/
|
|
149
|
+
containerLogs(id: string, query: Record<string, unknown>): Promise<IncomingMessage>;
|
|
150
|
+
/**
|
|
151
|
+
* The statistics of a container, once
|
|
152
|
+
* @param id
|
|
153
|
+
*/
|
|
154
|
+
containerStats(id: string): Promise<Record<string, any>>;
|
|
155
|
+
/**
|
|
156
|
+
* The tar archive of a path of a container
|
|
157
|
+
* @param id
|
|
158
|
+
* @param query path
|
|
159
|
+
*/
|
|
160
|
+
getArchive(id: string, query: {
|
|
161
|
+
path: string;
|
|
162
|
+
}): Promise<IncomingMessage>;
|
|
163
|
+
/**
|
|
164
|
+
* Create an execution in a container
|
|
165
|
+
* @param id
|
|
166
|
+
* @param body Cmd, AttachStdin, AttachStdout, AttachStderr, Tty, ConsoleSize...
|
|
167
|
+
*/
|
|
168
|
+
createExec(id: string, body: Record<string, unknown>): Promise<IdResponse>;
|
|
169
|
+
/**
|
|
170
|
+
* Start an execution, attached: its stream, read (its output, multiplexed without TTY) and written (its input)
|
|
171
|
+
* @param execId
|
|
172
|
+
* @param body Detach, Tty
|
|
173
|
+
*/
|
|
174
|
+
startExec(execId: string, body: {
|
|
175
|
+
Detach?: boolean;
|
|
176
|
+
Tty?: boolean;
|
|
177
|
+
}): Promise<Duplex>;
|
|
178
|
+
resizeExec(execId: string, query: {
|
|
179
|
+
h: number;
|
|
180
|
+
w: number;
|
|
181
|
+
}): Promise<void>;
|
|
182
|
+
inspectExec(execId: string): Promise<Record<string, any>>;
|
|
183
|
+
pruneContainers(query?: Record<string, unknown>): Promise<Record<string, any>>;
|
|
184
|
+
/** Networks **/
|
|
185
|
+
listNetworks(query?: Record<string, unknown>, signal?: AbortSignal): Promise<Record<string, any>[]>;
|
|
186
|
+
createNetwork(body: Record<string, unknown>): Promise<NetworkCreateResponse>;
|
|
187
|
+
inspectNetwork(id: string): Promise<Record<string, any>>;
|
|
188
|
+
removeNetwork(id: string): Promise<void>;
|
|
189
|
+
pruneNetworks(query?: Record<string, unknown>): Promise<Record<string, any>>;
|
|
190
|
+
/** Volumes **/
|
|
191
|
+
pruneVolumes(query?: Record<string, unknown>): Promise<Record<string, any>>;
|
|
192
|
+
/**
|
|
193
|
+
* Close the connections kept alive
|
|
194
|
+
*/
|
|
195
|
+
close(): void;
|
|
196
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { type Agent, type ClientRequest, type IncomingMessage, type RequestOptions } from 'node:http';
|
|
2
|
+
import { Duplex } from 'node:stream';
|
|
3
|
+
import { DockerRequestError } from './DockerRequestError.js';
|
|
4
|
+
/**
|
|
5
|
+
* A key of a TLS connection with its passphrase
|
|
6
|
+
*/
|
|
7
|
+
export type DockerKeyObject = {
|
|
8
|
+
pem: string | Buffer;
|
|
9
|
+
passphrase?: string;
|
|
10
|
+
};
|
|
11
|
+
export type DockerConnectionOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* The socket of the Docker daemon (a Unix socket, or a named pipe on Windows)
|
|
14
|
+
*/
|
|
15
|
+
socketPath?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The host of the Docker daemon (tcp, https, ssh)
|
|
18
|
+
*/
|
|
19
|
+
host?: string;
|
|
20
|
+
port?: number | string;
|
|
21
|
+
protocol?: 'http' | 'https' | 'ssh';
|
|
22
|
+
/**
|
|
23
|
+
* The user of the SSH connection
|
|
24
|
+
*/
|
|
25
|
+
username?: string;
|
|
26
|
+
password?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The SSH agent socket, the one of SSH_AUTH_SOCK by default
|
|
29
|
+
*/
|
|
30
|
+
sshAuthAgent?: string;
|
|
31
|
+
headers?: Record<string, string>;
|
|
32
|
+
ca?: string | string[] | Buffer | Buffer[];
|
|
33
|
+
cert?: string | string[] | Buffer | Buffer[];
|
|
34
|
+
key?: string | string[] | Buffer | Buffer[] | DockerKeyObject[];
|
|
35
|
+
/**
|
|
36
|
+
* The timeout of the requests, in milliseconds
|
|
37
|
+
*/
|
|
38
|
+
timeout?: number;
|
|
39
|
+
/**
|
|
40
|
+
* The API version ("1.47", or "v1.47"), negotiated with the daemon by default
|
|
41
|
+
*/
|
|
42
|
+
version?: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A request to the Engine API
|
|
46
|
+
*/
|
|
47
|
+
export type DockerRequest = {
|
|
48
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'HEAD';
|
|
49
|
+
path: string;
|
|
50
|
+
/**
|
|
51
|
+
* The query parameters: the objects are JSON encoded, the arrays repeat their parameter, the undefined ones are omitted
|
|
52
|
+
*/
|
|
53
|
+
query?: Record<string, unknown>;
|
|
54
|
+
/**
|
|
55
|
+
* A JSON body, or a stream sent as it is (a tar archive)
|
|
56
|
+
*/
|
|
57
|
+
body?: unknown;
|
|
58
|
+
headers?: Record<string, string>;
|
|
59
|
+
/**
|
|
60
|
+
* The registry credentials of the request (X-Registry-Auth)
|
|
61
|
+
*/
|
|
62
|
+
auth?: Record<string, unknown>;
|
|
63
|
+
/**
|
|
64
|
+
* The registry credentials of a build (X-Registry-Config)
|
|
65
|
+
*/
|
|
66
|
+
registryConfig?: Record<string, unknown>;
|
|
67
|
+
/**
|
|
68
|
+
* The meanings of the status codes: true for a success, the reason of the failure otherwise
|
|
69
|
+
*/
|
|
70
|
+
statusCodes: Record<number, true | string>;
|
|
71
|
+
signal?: AbortSignal;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The newest API version this client is tested with (Docker 29.8): the one negotiated when the daemon supports it, so that
|
|
75
|
+
* a newer daemon answers as the tested one. An older daemon answers with its version: the fields a version does not have
|
|
76
|
+
* are missing or null
|
|
77
|
+
*/
|
|
78
|
+
export declare const DOCKER_API_VERSION: string;
|
|
79
|
+
/**
|
|
80
|
+
* The oldest API version this client works with
|
|
81
|
+
*/
|
|
82
|
+
export declare const DOCKER_MIN_API_VERSION: string;
|
|
83
|
+
/**
|
|
84
|
+
* Compare two API versions
|
|
85
|
+
* @param a
|
|
86
|
+
* @param b
|
|
87
|
+
*/
|
|
88
|
+
export declare function compareAPIVersions(a: string, b: string): number;
|
|
89
|
+
/**
|
|
90
|
+
* The connection options given by the environment (DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH,
|
|
91
|
+
* DOCKER_CLIENT_TIMEOUT), else the socket of the platform: the named pipe on Windows, the socket of the user (Docker
|
|
92
|
+
* Desktop) or /var/run/docker.sock
|
|
93
|
+
*/
|
|
94
|
+
export declare function defaultConnectionOptions(): DockerConnectionOptions;
|
|
95
|
+
/**
|
|
96
|
+
* The connection to a Docker daemon
|
|
97
|
+
*/
|
|
98
|
+
export declare class DockerConnection {
|
|
99
|
+
#private;
|
|
100
|
+
constructor(options?: DockerConnectionOptions);
|
|
101
|
+
/**
|
|
102
|
+
* The API version of the requests, once negotiated
|
|
103
|
+
*/
|
|
104
|
+
get version(): string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Negotiate the API version with the daemon: the newest one both support
|
|
107
|
+
*/
|
|
108
|
+
negotiate(): Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* The agent of an SSH connection: the requests are sent to "docker system dial-stdio" (ssh2, an optional dependency)
|
|
111
|
+
*/
|
|
112
|
+
protected sshAgent(): Promise<Agent>;
|
|
113
|
+
/**
|
|
114
|
+
* The options of a request
|
|
115
|
+
* @param request
|
|
116
|
+
* @param streamingBody
|
|
117
|
+
*/
|
|
118
|
+
protected requestOptions(request: DockerRequest, streamingBody: boolean): Promise<RequestOptions>;
|
|
119
|
+
/**
|
|
120
|
+
* Send a request: the response, once its status is known
|
|
121
|
+
* @param request
|
|
122
|
+
* @param hijack upgrade the connection to a raw stream (the TTYs, the attached executions)
|
|
123
|
+
*/
|
|
124
|
+
protected send(request: DockerRequest, hijack?: boolean): Promise<{
|
|
125
|
+
response?: IncomingMessage;
|
|
126
|
+
socket?: Duplex;
|
|
127
|
+
request: ClientRequest;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* The error of a failed response
|
|
131
|
+
* @param request
|
|
132
|
+
* @param response
|
|
133
|
+
*/
|
|
134
|
+
protected failure(request: DockerRequest, response: IncomingMessage): Promise<DockerRequestError>;
|
|
135
|
+
/**
|
|
136
|
+
* A request whose response is JSON (or nothing)
|
|
137
|
+
* @param request
|
|
138
|
+
*/
|
|
139
|
+
request<T = any>(request: DockerRequest): Promise<T>;
|
|
140
|
+
/**
|
|
141
|
+
* A request whose response is a stream (the progress of a pull, the logs, an archive)
|
|
142
|
+
* @param request
|
|
143
|
+
*/
|
|
144
|
+
stream(request: DockerRequest): Promise<IncomingMessage>;
|
|
145
|
+
/**
|
|
146
|
+
* A request upgraded to a raw stream, read and written (the TTYs, the attached executions)
|
|
147
|
+
* @param request
|
|
148
|
+
*/
|
|
149
|
+
hijack(request: DockerRequest): Promise<Duplex>;
|
|
150
|
+
/**
|
|
151
|
+
* Close the kept alive connections
|
|
152
|
+
*/
|
|
153
|
+
close(): void;
|
|
154
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
type DockerIgnoreRule = {
|
|
2
|
+
pattern: string;
|
|
3
|
+
directories: string[];
|
|
4
|
+
negative: boolean;
|
|
5
|
+
expression?: RegExp;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The rules of a .dockerignore file: the files of a build context they exclude
|
|
9
|
+
*/
|
|
10
|
+
export declare class DockerIgnore {
|
|
11
|
+
#private;
|
|
12
|
+
protected readonly ignoreCase: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @param content the content of a .dockerignore file
|
|
15
|
+
* @param ignoreCase match the case-insensitively, as Docker does not (false by default)
|
|
16
|
+
*/
|
|
17
|
+
constructor(content?: string, ignoreCase?: boolean);
|
|
18
|
+
/**
|
|
19
|
+
* Add the rules of a content
|
|
20
|
+
* @param content
|
|
21
|
+
*/
|
|
22
|
+
add(content: string): this;
|
|
23
|
+
/**
|
|
24
|
+
* A rule of a line (moby/moby builder/dockerignore/dockerignore.go and pkg/fileutils/fileutils.go)
|
|
25
|
+
* @param line
|
|
26
|
+
*/
|
|
27
|
+
protected rule(line: string): DockerIgnoreRule | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The regular expression of a rule (fileutils.go regexpMatch)
|
|
30
|
+
* @param rule
|
|
31
|
+
*/
|
|
32
|
+
protected expression(rule: DockerIgnoreRule): RegExp;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a file of the context is excluded by the rules (its path relative to the context, "/" separated)
|
|
35
|
+
* @param file
|
|
36
|
+
*/
|
|
37
|
+
ignores(file: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether a file is excluded: the last rule matching it or one of its parent directories decides
|
|
40
|
+
* @param file
|
|
41
|
+
*/
|
|
42
|
+
protected test(file: string): boolean;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A request to the Docker Engine API which failed: its message is the one of docker-modem, "(HTTP code 404) no such
|
|
3
|
+
* container - No such container: x", the status and the body of the response are given
|
|
4
|
+
*/
|
|
5
|
+
export declare class DockerRequestError extends Error {
|
|
6
|
+
readonly statusCode: number;
|
|
7
|
+
readonly reason: string;
|
|
8
|
+
readonly detail: string;
|
|
9
|
+
readonly json?: unknown | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* @param statusCode the status of the response
|
|
12
|
+
* @param reason the meaning of the status for the request
|
|
13
|
+
* @param detail the message of the daemon
|
|
14
|
+
* @param json the body of the response
|
|
15
|
+
*/
|
|
16
|
+
constructor(statusCode: number, reason: string, detail: string, json?: unknown | undefined);
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Transform, type TransformCallback } from 'node:stream';
|
|
2
|
+
/**
|
|
3
|
+
* The stream of a frame of a multiplexed output
|
|
4
|
+
*/
|
|
5
|
+
export declare enum DockerStreamType {
|
|
6
|
+
STDIN = 0,
|
|
7
|
+
STDOUT = 1,
|
|
8
|
+
STDERR = 2
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The output of a container without TTY is multiplexed: each frame is a header of 8 bytes (the stream, 3 zeros, the
|
|
12
|
+
* size as a big endian uint32) and its content. The decoder gives the contents, in their order; its "frame" event
|
|
13
|
+
* gives each content with its stream
|
|
14
|
+
*/
|
|
15
|
+
export declare class DockerStreamDecoder extends Transform {
|
|
16
|
+
#private;
|
|
17
|
+
_transform(chunk: Buffer, _encoding: BufferEncoding, callback: TransformCallback): void;
|
|
18
|
+
_flush(callback: TransformCallback): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The output of a multiplexed stream (or buffer), and its outputs by stream
|
|
22
|
+
* @param input
|
|
23
|
+
*/
|
|
24
|
+
export declare function readMultiplexed(input: NodeJS.ReadableStream | Buffer): Promise<{
|
|
25
|
+
output: string;
|
|
26
|
+
stdout: string;
|
|
27
|
+
stderr: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Read the JSON lines of a progress (a pull, a push, a build, a load): each object is given to the callback, all of them
|
|
31
|
+
* are given back once the stream ends. The lines which are not JSON are skipped
|
|
32
|
+
* @param input
|
|
33
|
+
* @param onProgress
|
|
34
|
+
*/
|
|
35
|
+
export declare function followProgress<T = Record<string, any>>(input: NodeJS.ReadableStream, onProgress?: (progress: T) => void): Promise<T[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The query of stopping or restarting a container in the Docker Engine API
|
|
3
|
+
*/
|
|
4
|
+
export type ContainerStopQuery = {
|
|
5
|
+
/**
|
|
6
|
+
* The number of seconds to wait before killing the container
|
|
7
|
+
*/
|
|
8
|
+
t?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The signal to send to the container
|
|
11
|
+
*/
|
|
12
|
+
signal?: string;
|
|
13
|
+
};
|