@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,742 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DockerContainer = void 0;
|
|
13
|
+
const core_1 = require("@lakutata/core");
|
|
14
|
+
const di_1 = require("@lakutata/core/decorator/di");
|
|
15
|
+
const DockerStreams_js_1 = require("../../client/DockerStreams.js");
|
|
16
|
+
const utils_1 = require("@lakutata/utils");
|
|
17
|
+
const node_crypto_1 = require("node:crypto");
|
|
18
|
+
const promises_1 = require("node:timers/promises");
|
|
19
|
+
const Time_1 = require("@lakutata/utils/Time");
|
|
20
|
+
const dto_1 = require("@lakutata/core/decorator/dto");
|
|
21
|
+
const ContainerStopOptions_js_1 = require("../options/container/ContainerStopOptions.js");
|
|
22
|
+
const ContainerRemoveOptions_js_1 = require("../options/container/ContainerRemoveOptions.js");
|
|
23
|
+
const ContainerSettingOptions_js_1 = require("../options/container/ContainerSettingOptions.js");
|
|
24
|
+
const ContainerKillOptions_js_1 = require("../options/container/ContainerKillOptions.js");
|
|
25
|
+
const ParseEnvToRecord_js_1 = require("./ParseEnvToRecord.js");
|
|
26
|
+
const ContainerCommitOptions_js_1 = require("../options/container/ContainerCommitOptions.js");
|
|
27
|
+
const ParseRepositoryTag_js_1 = require("./ParseRepositoryTag.js");
|
|
28
|
+
const DockerContainerTTY_js_1 = require("./DockerContainerTTY.js");
|
|
29
|
+
const ContainerCreateTTYOptions_js_1 = require("../options/container/ContainerCreateTTYOptions.js");
|
|
30
|
+
const ContainerLogsOptions_js_1 = require("../options/container/ContainerLogsOptions.js");
|
|
31
|
+
const ContainerExecOptions_js_1 = require("../options/container/ContainerExecOptions.js");
|
|
32
|
+
const ContainerExportDirectoryOptions_js_1 = require("../options/container/ContainerExportDirectoryOptions.js");
|
|
33
|
+
const promises_2 = require("stream/promises");
|
|
34
|
+
const node_fs_1 = require("node:fs");
|
|
35
|
+
const DockerImageNotFoundException_js_1 = require("../exceptions/DockerImageNotFoundException.js");
|
|
36
|
+
const DockerContainerNotFoundException_js_1 = require("../exceptions/DockerContainerNotFoundException.js");
|
|
37
|
+
const EngineSettings_js_1 = require("./EngineSettings.js");
|
|
38
|
+
/**
|
|
39
|
+
* A container of the Docker daemon, with its settings and its state as inspected, and its operations: start, stop,
|
|
40
|
+
* restart, pause, kill, remove, update, commit, exec, TTYs, logs, stats and the export of its files. It is not created
|
|
41
|
+
* with `new`: {@link Docker.getContainer}, {@link Docker.listContainers}, {@link Docker.createContainer} and
|
|
42
|
+
* {@link DockerImage.run} return it.
|
|
43
|
+
*
|
|
44
|
+
* Its properties are a snapshot, taken when it is obtained and refreshed by its own operations (`start()`, `stop()`,
|
|
45
|
+
* `restart()`, `pause()`, `unpause()`, `kill()`, `update()`): the changes made by others (the container exiting,
|
|
46
|
+
* `docker stop`) are seen by getting it again. Its operations reject with {@link DockerContainerNotFoundException} when
|
|
47
|
+
* the container was removed, with {@link DockerRequestException} when the daemon refuses them otherwise (not running:
|
|
48
|
+
* HTTP 409), and with the network error of Node.js when the daemon cannot be reached.
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import {type Docker, type DockerContainer, type DockerImage} from 'lakutata/com/docker'
|
|
52
|
+
*
|
|
53
|
+
* declare const docker: Docker
|
|
54
|
+
*
|
|
55
|
+
* const image: DockerImage = await docker.getImage('alpine:3.20')
|
|
56
|
+
* const container: DockerContainer = await docker.createContainer(image.id, {
|
|
57
|
+
* name: 'worker',
|
|
58
|
+
* cmd: ['sh', '-c', 'echo started; sleep 3600'],
|
|
59
|
+
* env: {MODE: 'production'},
|
|
60
|
+
* ports: [{port: 8080, type: 'tcp', hostPorts: [18080]}],
|
|
61
|
+
* binds: [{hostPath: '/srv/data', containerPath: '/data', rw: true}],
|
|
62
|
+
* restartPolicy: 'unless-stopped'
|
|
63
|
+
* })
|
|
64
|
+
* await container.start()
|
|
65
|
+
* console.log(container.state.status, container.ports)
|
|
66
|
+
* //The exit code, stdout and stderr
|
|
67
|
+
* const {exitCode, stdout} = await container.exec({cmd: ['ls', '/data']})
|
|
68
|
+
* console.log(exitCode, stdout)
|
|
69
|
+
* await container.stop({timeout: 10})
|
|
70
|
+
* await container.remove()
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
let DockerContainer = class DockerContainer extends core_1.Provider {
|
|
74
|
+
#abortController = new AbortController();
|
|
75
|
+
/**
|
|
76
|
+
* Inspect the container.
|
|
77
|
+
* @throws {DockerContainerNotFoundException} When the container does not exist.
|
|
78
|
+
* @protected
|
|
79
|
+
*/
|
|
80
|
+
async init() {
|
|
81
|
+
await this.syncContainerInfo();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Abort the requests in progress of the object (the container itself is left as it is).
|
|
85
|
+
* @protected
|
|
86
|
+
*/
|
|
87
|
+
async destroy() {
|
|
88
|
+
this.#abortController.abort();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Refresh the properties from the daemon's inspection of the container, and its image (`undefined` when it no longer
|
|
92
|
+
* exists).
|
|
93
|
+
* @throws {DockerContainerNotFoundException} When the container does not exist.
|
|
94
|
+
* @protected
|
|
95
|
+
*/
|
|
96
|
+
async syncContainerInfo() {
|
|
97
|
+
try {
|
|
98
|
+
const inspectInfo = await this.getClient().inspectContainer(this.id, this.#abortController.signal);
|
|
99
|
+
//Got by its name or a short ID: its full ID
|
|
100
|
+
this.id = inspectInfo.Id;
|
|
101
|
+
this.createdAt = new Time_1.Time(inspectInfo.Created);
|
|
102
|
+
this.name = inspectInfo.Name.substring(1);
|
|
103
|
+
this.hostname = inspectInfo.Config.Hostname;
|
|
104
|
+
try {
|
|
105
|
+
this.image = await this.getDocker().getImage(inspectInfo.Image);
|
|
106
|
+
}
|
|
107
|
+
catch (e) {
|
|
108
|
+
//Its image removed with force: the container is read without it
|
|
109
|
+
if (!(e instanceof DockerImageNotFoundException_js_1.DockerImageNotFoundException))
|
|
110
|
+
throw e;
|
|
111
|
+
this.image = undefined;
|
|
112
|
+
}
|
|
113
|
+
this.restartCount = inspectInfo.RestartCount;
|
|
114
|
+
this.state = {
|
|
115
|
+
status: (0, utils_1.As)(inspectInfo.State.Status),
|
|
116
|
+
running: inspectInfo.State.Running,
|
|
117
|
+
paused: inspectInfo.State.Paused,
|
|
118
|
+
restarting: inspectInfo.State.Restarting,
|
|
119
|
+
OOMKilled: inspectInfo.State.OOMKilled,
|
|
120
|
+
dead: inspectInfo.State.Dead,
|
|
121
|
+
pid: inspectInfo.State.Pid,
|
|
122
|
+
exitCode: inspectInfo.State.ExitCode,
|
|
123
|
+
startedAt: this.#time(inspectInfo.State.StartedAt),
|
|
124
|
+
finishedAt: this.#time(inspectInfo.State.FinishedAt)
|
|
125
|
+
};
|
|
126
|
+
const networkSettings = inspectInfo.NetworkSettings ? inspectInfo.NetworkSettings.Networks ? inspectInfo.NetworkSettings.Networks : {} : {};
|
|
127
|
+
this.tty = inspectInfo.Config.Tty;
|
|
128
|
+
this.OOMKillDisable = !!inspectInfo.HostConfig.OomKillDisable;
|
|
129
|
+
this.networks = Object.keys(networkSettings).map((networkSettingName) => ({
|
|
130
|
+
networkName: networkSettingName,
|
|
131
|
+
networkId: networkSettings[networkSettingName].NetworkID,
|
|
132
|
+
endpointId: networkSettings[networkSettingName].EndpointID,
|
|
133
|
+
mac: networkSettings[networkSettingName].MacAddress,
|
|
134
|
+
ip: networkSettings[networkSettingName].IPAddress,
|
|
135
|
+
gateway: networkSettings[networkSettingName].Gateway,
|
|
136
|
+
ipPrefixLen: networkSettings[networkSettingName].IPPrefixLen,
|
|
137
|
+
ipv6: networkSettings[networkSettingName].GlobalIPv6Address,
|
|
138
|
+
ipv6Gateway: networkSettings[networkSettingName].IPv6Gateway,
|
|
139
|
+
ipv6PrefixLen: networkSettings[networkSettingName].GlobalIPv6PrefixLen
|
|
140
|
+
}));
|
|
141
|
+
const containerIpAddresses = [];
|
|
142
|
+
this.networks.forEach((network) => {
|
|
143
|
+
if (network.ip)
|
|
144
|
+
containerIpAddresses.push(network.ip);
|
|
145
|
+
if (network.ipv6)
|
|
146
|
+
containerIpAddresses.push(`[${network.ipv6}]`);
|
|
147
|
+
});
|
|
148
|
+
const ports = [];
|
|
149
|
+
const portMap = new Map();
|
|
150
|
+
this.image?.config.ports?.forEach((exposePortInfo) => {
|
|
151
|
+
containerIpAddresses.forEach((containerIpAddress) => {
|
|
152
|
+
const types = [];
|
|
153
|
+
if (exposePortInfo.tcp)
|
|
154
|
+
types.push('tcp');
|
|
155
|
+
if (exposePortInfo.udp)
|
|
156
|
+
types.push('udp');
|
|
157
|
+
types.forEach(type => {
|
|
158
|
+
const portMapKey = `${containerIpAddress}_${exposePortInfo.port}_${type}`;
|
|
159
|
+
if (!portMap.has(portMapKey))
|
|
160
|
+
portMap.set(portMapKey, []);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
if (inspectInfo.NetworkSettings.Ports) {
|
|
165
|
+
Object.keys(inspectInfo.NetworkSettings.Ports).forEach((portWithType) => {
|
|
166
|
+
const portInfo = portWithType.split('/');
|
|
167
|
+
const port = parseInt(portInfo[0]);
|
|
168
|
+
const type = (0, utils_1.As)(portInfo[1].toLowerCase());
|
|
169
|
+
inspectInfo.NetworkSettings.Ports[portWithType]?.forEach((hostBinding) => {
|
|
170
|
+
containerIpAddresses.forEach((containerIpAddress) => {
|
|
171
|
+
const portMapKey = `${containerIpAddress}_${port}_${type}`;
|
|
172
|
+
if (!portMap.has(portMapKey))
|
|
173
|
+
portMap.set(portMapKey, []);
|
|
174
|
+
//A host port is bound on the IPv4 and the IPv6 addresses of the host: listed once
|
|
175
|
+
const hostPorts = portMap.get(portMapKey);
|
|
176
|
+
const hostPort = parseInt(hostBinding.HostPort);
|
|
177
|
+
if (!hostPorts.includes(hostPort))
|
|
178
|
+
hostPorts.push(hostPort);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
portMap.forEach((hostPorts, portMapKey) => {
|
|
184
|
+
const infos = portMapKey.split('_');
|
|
185
|
+
const containerIpAddress = infos[0];
|
|
186
|
+
const port = parseInt(infos[1]);
|
|
187
|
+
const type = (0, utils_1.As)(infos[2]);
|
|
188
|
+
ports.push({
|
|
189
|
+
host: containerIpAddress,
|
|
190
|
+
port: port,
|
|
191
|
+
type: type,
|
|
192
|
+
hostPorts: hostPorts
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
this.ports = ports;
|
|
196
|
+
const binds = [];
|
|
197
|
+
for (const mount of inspectInfo.Mounts ?? []) {
|
|
198
|
+
if (mount.Type === 'bind') {
|
|
199
|
+
binds.push({
|
|
200
|
+
hostPath: mount.Source,
|
|
201
|
+
containerPath: mount.Destination,
|
|
202
|
+
rw: mount.RW
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
this.binds = binds;
|
|
207
|
+
this.devices = inspectInfo.HostConfig.Devices ? (0, utils_1.As)(inspectInfo.HostConfig.Devices).map(device => ({
|
|
208
|
+
hostPath: device.PathOnHost,
|
|
209
|
+
containerPath: device.PathInContainer,
|
|
210
|
+
cgroupPermissions: device.CgroupPermissions
|
|
211
|
+
})) : [];
|
|
212
|
+
this.memoryLimit = inspectInfo.HostConfig.Memory ? inspectInfo.HostConfig.Memory : 0;
|
|
213
|
+
this.privileged = !!inspectInfo.HostConfig.Privileged;
|
|
214
|
+
this.restartPolicy = (0, EngineSettings_js_1.parseRestartPolicy)(inspectInfo.HostConfig.RestartPolicy);
|
|
215
|
+
this.cgroup = inspectInfo.HostConfig.Cgroup;
|
|
216
|
+
this.cgroupParent = inspectInfo.HostConfig.CgroupParent;
|
|
217
|
+
this.pidMode = inspectInfo.HostConfig.PidMode;
|
|
218
|
+
const cpuSetString = inspectInfo.HostConfig.CpusetCpus ? inspectInfo.HostConfig.CpusetCpus : '';
|
|
219
|
+
const cpuSetArray = cpuSetString.split(',');
|
|
220
|
+
const cpuIndexesArray = cpuSetArray.map((cpuSetItem) => {
|
|
221
|
+
if (cpuSetItem.includes('-')) {
|
|
222
|
+
const [min, max] = cpuSetItem.split('-');
|
|
223
|
+
const cpuIndexes = [];
|
|
224
|
+
if (!min || !max)
|
|
225
|
+
return cpuIndexes;
|
|
226
|
+
for (let i = parseInt(min); i <= parseInt(max); i++)
|
|
227
|
+
cpuIndexes.push(i);
|
|
228
|
+
return cpuIndexes;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return [parseInt(cpuSetItem)];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
let cpuSet = [];
|
|
235
|
+
cpuIndexesArray.forEach((cpuIndexes) => {
|
|
236
|
+
cpuSet = [...cpuIndexes, ...cpuSet];
|
|
237
|
+
});
|
|
238
|
+
this.cpuSet = (0, utils_1.uniqueArray)(cpuSet).sort((a, b) => a - b).filter(value => typeof value === 'number' && !isNaN(value));
|
|
239
|
+
this.env = (0, ParseEnvToRecord_js_1.parseEnvToRecord)(inspectInfo.Config.Env);
|
|
240
|
+
this.capabilities = inspectInfo.HostConfig.CapAdd ? inspectInfo.HostConfig.CapAdd : [];
|
|
241
|
+
}
|
|
242
|
+
catch (e) {
|
|
243
|
+
if (!(0, utils_1.isAbortError)(e))
|
|
244
|
+
throw e;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* The time of a date of the state: null for Docker's zero date (never)
|
|
249
|
+
* @param date
|
|
250
|
+
*/
|
|
251
|
+
#time(date) {
|
|
252
|
+
if (!date || date.startsWith('0001-01-01'))
|
|
253
|
+
return null;
|
|
254
|
+
return new Time_1.Time(date);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Start the container, as `docker start`, then refresh its properties. A container already running is left as it is
|
|
258
|
+
* (as the Docker CLI does).
|
|
259
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
260
|
+
* @throws {DockerRequestException} When it fails to start (HTTP 500: a command not found, a port already used).
|
|
261
|
+
*/
|
|
262
|
+
async start() {
|
|
263
|
+
try {
|
|
264
|
+
await this.getClient().startContainer(this.id, this.#abortController.signal);
|
|
265
|
+
await this.syncContainerInfo();
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
if (!(0, utils_1.isAbortError)(e))
|
|
269
|
+
throw e;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Stop the container, as `docker stop`: send its stop signal, wait for it to exit, kill it after the timeout; then
|
|
274
|
+
* refresh its properties.
|
|
275
|
+
* @param options The signal sent (the container's stop signal, `SIGTERM` by default) and the timeout before the kill,
|
|
276
|
+
* in seconds (the container's, 10 by default). A container already stopped is left as it is (as the Docker CLI does).
|
|
277
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
278
|
+
*/
|
|
279
|
+
async stop(options) {
|
|
280
|
+
if (!options)
|
|
281
|
+
return await this.stop({});
|
|
282
|
+
try {
|
|
283
|
+
await this.getClient().stopContainer(this.id, { signal: options.signal, t: options.timeout }, this.#abortController.signal);
|
|
284
|
+
await this.syncContainerInfo();
|
|
285
|
+
}
|
|
286
|
+
catch (e) {
|
|
287
|
+
if (!(0, utils_1.isAbortError)(e))
|
|
288
|
+
throw e;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Suspend the processes of the container, as `docker pause`, then refresh its properties.
|
|
293
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
294
|
+
* @throws {DockerRequestException} When it is not running or already paused (HTTP 409).
|
|
295
|
+
*/
|
|
296
|
+
async pause() {
|
|
297
|
+
await this.getClient().pauseContainer(this.id);
|
|
298
|
+
await this.syncContainerInfo();
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Resume the processes of a paused container, as `docker unpause`, then refresh its properties.
|
|
302
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
303
|
+
* @throws {DockerRequestException} When it is not paused (HTTP 409).
|
|
304
|
+
*/
|
|
305
|
+
async unpause() {
|
|
306
|
+
await this.getClient().unpauseContainer(this.id);
|
|
307
|
+
await this.syncContainerInfo();
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Restart the container, as `docker restart`: stop it as {@link DockerContainer.stop} does (when it runs), then start
|
|
311
|
+
* it; then refresh its properties.
|
|
312
|
+
* @param options The signal sent (the container's stop signal, `SIGTERM` by default) and the timeout before the kill,
|
|
313
|
+
* in seconds (the container's, 10 by default).
|
|
314
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
315
|
+
* @throws {DockerRequestException} When it fails to start (HTTP 500).
|
|
316
|
+
*/
|
|
317
|
+
async restart(options) {
|
|
318
|
+
if (!options)
|
|
319
|
+
return await this.restart({});
|
|
320
|
+
try {
|
|
321
|
+
await this.getClient().restartContainer(this.id, { signal: options.signal, t: options.timeout }, this.#abortController.signal);
|
|
322
|
+
await this.syncContainerInfo();
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
if (!(0, utils_1.isAbortError)(e))
|
|
326
|
+
throw e;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Remove the container, as `docker rm -v`: its anonymous volumes are removed with it. The object is not refreshed:
|
|
331
|
+
* its other operations then fail with {@link DockerContainerNotFoundException}.
|
|
332
|
+
* @param options `force` kills a running container first (`false` by default).
|
|
333
|
+
* @throws {DockerContainerNotFoundException} When the container was already removed.
|
|
334
|
+
* @throws {DockerRequestException} When it is running and `force` is not set (HTTP 409).
|
|
335
|
+
*/
|
|
336
|
+
async remove(options) {
|
|
337
|
+
if (!options)
|
|
338
|
+
return await this.remove({});
|
|
339
|
+
await this.getClient().removeContainer(this.id, { force: !!options.force, v: true });
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Change the settings of the container, keeping the others. The memory limit, the CPUs and the restart policy are
|
|
343
|
+
* changed live, as `docker update` does, and the name by renaming it, the container running on. The other
|
|
344
|
+
* settings (and removing the memory limit or the CPU set, which Docker cannot do live) recreate the container: a new
|
|
345
|
+
* one is created from the old one's whole configuration (its image, command, entrypoint, environment, mounts,
|
|
346
|
+
* networks and their static addresses, the addresses Docker assigned being assigned again), with the settings
|
|
347
|
+
* changed, under a temporary name. Once created (and, when the old one was running, the old one stopped and the new
|
|
348
|
+
* one started), the old one is removed without its volumes and the new one takes its name (and its anonymous
|
|
349
|
+
* volumes, mounted again). The object follows the new container: its `id` changes.
|
|
350
|
+
* @remarks The old container is kept when the creation or the start of the new one fails (invalid settings, the
|
|
351
|
+
* image removed, a network missing): the new one is removed, the old one started again when it was running, and the
|
|
352
|
+
* call rejects. Its files outside the volumes are not kept by a recreation (commit them first, see
|
|
353
|
+
* {@link DockerContainer.commit}). A container removed by Docker when it stops (`AutoRemove`) cannot be kept.
|
|
354
|
+
* @param options The settings changed: `memoryLimit`, `cpuSet` and `restartPolicy` live (the swap limit set to
|
|
355
|
+
* Docker's default with the memory), `name` by a renaming; `hostname`, `env` (replacing the container's variables;
|
|
356
|
+
* the image's are added again), `cmd`, `entrypoint`, `tty`, `privileged`, `ports`, `binds` (replacing the bind
|
|
357
|
+
* mounts, the volumes kept), `devices`, `networks` (replacing the networks), `capabilities`, `OOMKillDisable`,
|
|
358
|
+
* `cgroup`, `cgroupParent` and `pidMode` by a recreation. The settings absent are kept.
|
|
359
|
+
* @throws {InvalidMethodAcceptException} When the settings are invalid.
|
|
360
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
361
|
+
* @throws {DockerImageNotFoundException} When the container must be recreated and its image no longer exists.
|
|
362
|
+
* @throws {DockerNetworkNotFoundException} When a network of the settings is not found.
|
|
363
|
+
* @throws {DockerRequestException} When the daemon refuses the changes: a limit refused (HTTP 400), the name
|
|
364
|
+
* already used (HTTP 409), the new container failing to start (HTTP 500).
|
|
365
|
+
*/
|
|
366
|
+
async update(options) {
|
|
367
|
+
const changes = (0, utils_1.As)(Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined)));
|
|
368
|
+
const inspectInfo = await this.getClient().inspectContainer(this.id);
|
|
369
|
+
const name = changes.name ?? inspectInfo.Name.substring(1);
|
|
370
|
+
//The resources Docker sets live (it cannot remove a limit live), and the restart policy
|
|
371
|
+
const resources = {};
|
|
372
|
+
let recreated = false;
|
|
373
|
+
for (const key of Object.keys(changes)) {
|
|
374
|
+
if (key === 'name')
|
|
375
|
+
continue;
|
|
376
|
+
//No limit to remove
|
|
377
|
+
if ((key === 'memoryLimit' && !changes.memoryLimit && !inspectInfo.HostConfig.Memory) || (key === 'cpuSet' && !changes.cpuSet.length && !inspectInfo.HostConfig.CpusetCpus))
|
|
378
|
+
continue;
|
|
379
|
+
if (key === 'memoryLimit' && changes.memoryLimit) {
|
|
380
|
+
resources.Memory = changes.memoryLimit;
|
|
381
|
+
//As much swap as memory, Docker's default, unless the swap is unlimited
|
|
382
|
+
if (inspectInfo.HostConfig.MemorySwap !== -1)
|
|
383
|
+
resources.MemorySwap = changes.memoryLimit * 2;
|
|
384
|
+
}
|
|
385
|
+
else if (key === 'cpuSet' && changes.cpuSet.length) {
|
|
386
|
+
resources.CpusetCpus = changes.cpuSet.join(',');
|
|
387
|
+
}
|
|
388
|
+
else if (key === 'restartPolicy') {
|
|
389
|
+
resources.RestartPolicy = (0, EngineSettings_js_1.engineRestartPolicy)(changes.restartPolicy || 'no');
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
recreated = true;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (recreated) {
|
|
396
|
+
await this.#recreate(inspectInfo, changes, name);
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
if (Object.keys(resources).length)
|
|
400
|
+
await this.getClient().updateContainer(this.id, resources);
|
|
401
|
+
if (name !== inspectInfo.Name.substring(1))
|
|
402
|
+
await this.getClient().renameContainer(this.id, name);
|
|
403
|
+
}
|
|
404
|
+
await this.syncContainerInfo();
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Recreate the container from its configuration, with the settings changed: created under a temporary name, it
|
|
408
|
+
* replaces the old one once created
|
|
409
|
+
* @param inspectInfo The inspection of the container
|
|
410
|
+
* @param changes The settings changed
|
|
411
|
+
* @param name The name of the container
|
|
412
|
+
*/
|
|
413
|
+
async #recreate(inspectInfo, changes, name) {
|
|
414
|
+
const config = { ...inspectInfo.Config };
|
|
415
|
+
const hostConfig = { ...inspectInfo.HostConfig };
|
|
416
|
+
//By its ID: the name it was created with may be another image's now
|
|
417
|
+
config.Image = inspectInfo.Image;
|
|
418
|
+
//The host name Docker gave (the short ID), or the one of the container whose network it shares, is not kept
|
|
419
|
+
if (config.Hostname === inspectInfo.Id.substring(0, 12) || /^container:/.test(hostConfig.NetworkMode ?? ''))
|
|
420
|
+
delete config.Hostname;
|
|
421
|
+
if (changes.hostname !== undefined)
|
|
422
|
+
config.Hostname = changes.hostname;
|
|
423
|
+
if (changes.tty !== undefined)
|
|
424
|
+
config.Tty = changes.tty;
|
|
425
|
+
if (changes.env)
|
|
426
|
+
config.Env = Object.keys(changes.env).map((envKey) => `${envKey}=${changes.env[envKey]}`);
|
|
427
|
+
if (changes.cmd)
|
|
428
|
+
config.Cmd = changes.cmd;
|
|
429
|
+
if (changes.entrypoint)
|
|
430
|
+
config.Entrypoint = changes.entrypoint;
|
|
431
|
+
if (changes.privileged !== undefined)
|
|
432
|
+
hostConfig.Privileged = changes.privileged;
|
|
433
|
+
if (changes.memoryLimit !== undefined) {
|
|
434
|
+
hostConfig.Memory = changes.memoryLimit;
|
|
435
|
+
//Docker's default swap, unless the swap is unlimited
|
|
436
|
+
if (hostConfig.MemorySwap !== -1)
|
|
437
|
+
hostConfig.MemorySwap = 0;
|
|
438
|
+
}
|
|
439
|
+
if (changes.cpuSet)
|
|
440
|
+
hostConfig.CpusetCpus = changes.cpuSet.join(',');
|
|
441
|
+
if (changes.restartPolicy !== undefined)
|
|
442
|
+
hostConfig.RestartPolicy = (0, EngineSettings_js_1.engineRestartPolicy)(changes.restartPolicy || 'no');
|
|
443
|
+
if (changes.OOMKillDisable !== undefined)
|
|
444
|
+
hostConfig.OomKillDisable = changes.OOMKillDisable;
|
|
445
|
+
if (changes.capabilities)
|
|
446
|
+
hostConfig.CapAdd = changes.capabilities;
|
|
447
|
+
if (changes.cgroup !== undefined)
|
|
448
|
+
hostConfig.Cgroup = changes.cgroup;
|
|
449
|
+
if (changes.cgroupParent !== undefined)
|
|
450
|
+
hostConfig.CgroupParent = changes.cgroupParent;
|
|
451
|
+
if (changes.pidMode !== undefined)
|
|
452
|
+
hostConfig.PidMode = changes.pidMode;
|
|
453
|
+
if (changes.devices)
|
|
454
|
+
hostConfig.Devices = (0, EngineSettings_js_1.engineDevices)(changes.devices);
|
|
455
|
+
if (changes.ports) {
|
|
456
|
+
hostConfig.PortBindings = (0, EngineSettings_js_1.enginePortBindings)(changes.ports);
|
|
457
|
+
config.ExposedPorts = { ...config.ExposedPorts, ...Object.fromEntries(Object.keys(hostConfig.PortBindings).map((port) => [port, {}])) };
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
//Each host port once
|
|
461
|
+
hostConfig.PortBindings = Object.fromEntries(Object.entries(hostConfig.PortBindings ?? {}).map(([port, bindings]) => [
|
|
462
|
+
port,
|
|
463
|
+
bindings ? bindings.filter((binding, index) => bindings.findIndex((other) => other.HostIp === binding.HostIp && other.HostPort === binding.HostPort) === index) : null
|
|
464
|
+
]));
|
|
465
|
+
}
|
|
466
|
+
if (changes.binds) {
|
|
467
|
+
//The bind mounts replaced (their source is a host path), the volumes kept
|
|
468
|
+
hostConfig.Binds = [...(hostConfig.Binds ?? []).filter((bind) => !/^(\/|[a-zA-Z]:\\)/.test(bind)), ...(0, EngineSettings_js_1.engineBinds)(changes.binds)];
|
|
469
|
+
hostConfig.Mounts = (hostConfig.Mounts ?? []).filter((mount) => mount.Type !== 'bind');
|
|
470
|
+
}
|
|
471
|
+
//The anonymous volumes mounted again by their names: the old container is removed without them
|
|
472
|
+
const mounted = [
|
|
473
|
+
...(hostConfig.Binds ?? []).map((bind) => bind.split(':')[1]),
|
|
474
|
+
...(hostConfig.Mounts ?? []).map((mount) => mount.Target)
|
|
475
|
+
];
|
|
476
|
+
const anonymousVolumes = (inspectInfo.Mounts ?? []).filter((mount) => mount.Type === 'volume' && !mounted.includes(mount.Destination));
|
|
477
|
+
if (anonymousVolumes.length)
|
|
478
|
+
hostConfig.Mounts = [...(hostConfig.Mounts ?? []), ...anonymousVolumes.map((mount) => ({
|
|
479
|
+
Type: 'volume',
|
|
480
|
+
Source: mount.Name,
|
|
481
|
+
Target: mount.Destination,
|
|
482
|
+
ReadOnly: !mount.RW
|
|
483
|
+
}))];
|
|
484
|
+
let endpoints;
|
|
485
|
+
if (changes.networks) {
|
|
486
|
+
endpoints = (0, EngineSettings_js_1.engineEndpoints)(changes.networks);
|
|
487
|
+
if (changes.networks.length && !/^(host|none|container:)/.test(hostConfig.NetworkMode ?? ''))
|
|
488
|
+
hostConfig.NetworkMode = changes.networks[0].networkName;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
//The networks kept as configured: their static addresses only (IPAMConfig), the others assigned again
|
|
492
|
+
const networks = inspectInfo.NetworkSettings?.Networks ?? {};
|
|
493
|
+
endpoints = Object.fromEntries(Object.entries(networks).map(([networkName, endpoint]) => [networkName, {
|
|
494
|
+
IPAMConfig: endpoint.IPAMConfig ?? undefined,
|
|
495
|
+
Links: endpoint.Links ?? undefined,
|
|
496
|
+
Aliases: endpoint.Aliases?.filter((alias) => alias !== inspectInfo.Id.substring(0, 12)) ?? undefined,
|
|
497
|
+
DriverOpts: endpoint.DriverOpts ?? undefined,
|
|
498
|
+
GwPriority: endpoint.GwPriority
|
|
499
|
+
}]));
|
|
500
|
+
}
|
|
501
|
+
//The platform of the image used: an image may have several
|
|
502
|
+
const platform = inspectInfo.ImageManifestDescriptor?.platform;
|
|
503
|
+
const created = await this.getClient().createContainer({
|
|
504
|
+
...config,
|
|
505
|
+
HostConfig: hostConfig,
|
|
506
|
+
NetworkingConfig: { EndpointsConfig: endpoints }
|
|
507
|
+
}, {
|
|
508
|
+
name: `${name}-update-${(0, node_crypto_1.randomBytes)(4).toString('hex')}`,
|
|
509
|
+
platform: platform?.os && platform.architecture ? [platform.os, platform.architecture, platform.variant].filter(Boolean).join('/') : undefined
|
|
510
|
+
});
|
|
511
|
+
//Created: the old container is replaced once the new one runs (its ports and addresses freed by the old one), and
|
|
512
|
+
//is kept, started again, when the new one cannot start or the old one cannot be removed
|
|
513
|
+
const running = !!inspectInfo.State?.Running;
|
|
514
|
+
try {
|
|
515
|
+
if (running) {
|
|
516
|
+
await this.getClient().stopContainer(this.id);
|
|
517
|
+
await this.getClient().startContainer(created.Id);
|
|
518
|
+
}
|
|
519
|
+
await this.getClient().removeContainer(this.id, { force: true, v: false }).catch((error) => {
|
|
520
|
+
//Removed by itself once stopped (AutoRemove)
|
|
521
|
+
if (!(error instanceof DockerContainerNotFoundException_js_1.DockerContainerNotFoundException))
|
|
522
|
+
throw error;
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
catch (e) {
|
|
526
|
+
await this.getClient().removeContainer(created.Id, { force: true, v: false }).catch(() => undefined);
|
|
527
|
+
if (running)
|
|
528
|
+
await this.getClient().startContainer(this.id).catch(() => undefined);
|
|
529
|
+
throw e;
|
|
530
|
+
}
|
|
531
|
+
this.id = created.Id;
|
|
532
|
+
await this.getClient().renameContainer(this.id, name);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Create an image from the container's current files, as `docker commit`.
|
|
536
|
+
* @param options The name of the image (`repoTag`, `repo:tag`; none by default) and whether the container is paused
|
|
537
|
+
* while it is committed (`pauseBeforeCommitting`, `true` by default).
|
|
538
|
+
* @returns The image created.
|
|
539
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
540
|
+
*/
|
|
541
|
+
async commit(options) {
|
|
542
|
+
if (!options)
|
|
543
|
+
return await this.commit({});
|
|
544
|
+
let repo = undefined;
|
|
545
|
+
let tag = undefined;
|
|
546
|
+
if (options.repoTag) {
|
|
547
|
+
const parseResult = (0, ParseRepositoryTag_js_1.parseRepositoryTag)(options.repoTag);
|
|
548
|
+
repo = parseResult.repo;
|
|
549
|
+
tag = parseResult.tag;
|
|
550
|
+
}
|
|
551
|
+
const commitResult = await this.getClient().commitContainer(this.id, {
|
|
552
|
+
repo: repo,
|
|
553
|
+
tag: tag,
|
|
554
|
+
pause: options.pauseBeforeCommitting !== undefined ? options.pauseBeforeCommitting : true
|
|
555
|
+
});
|
|
556
|
+
return await this.getDocker().getImage(commitResult.Id);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Start an interactive command with a TTY in the running container, as `docker exec -it`. The command runs until it
|
|
560
|
+
* exits (or its stream is closed): see {@link DockerContainerTTY}.
|
|
561
|
+
* @param options The command (`['/bin/sh']` by default; the program and its arguments, run as they are, or a command
|
|
562
|
+
* line, run by `/bin/sh -c`) and the initial console size.
|
|
563
|
+
* @returns The TTY, its command started.
|
|
564
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
565
|
+
* @throws {DockerRequestException} When the container is not running (HTTP 409).
|
|
566
|
+
*/
|
|
567
|
+
async createTTY(options) {
|
|
568
|
+
return await this.getObject(DockerContainerTTY_js_1.DockerContainerTTY, {
|
|
569
|
+
getClient: this.getClient,
|
|
570
|
+
containerId: this.id,
|
|
571
|
+
cmd: typeof options?.cmd === 'string' ? ['/bin/sh', '-c', options.cmd] : options?.cmd ?? ['/bin/sh'],
|
|
572
|
+
initialConsoleSize: options?.consoleSize
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Read the logs of the container's main process, as `docker logs`: stdout and stderr in one stream, in their order
|
|
577
|
+
* (split from Docker's multiplexed format unless the container has a TTY).
|
|
578
|
+
* @remarks The logs are followed by default: the stream does not end while the container runs. Pass `follow: false`
|
|
579
|
+
* for the logs written so far.
|
|
580
|
+
* @param options `follow` (`true` by default), `since` and `until` (UNIX timestamps in seconds; `0`, no bound, by
|
|
581
|
+
* default), `timestamps` (`false` by default) and `tail` (a number of lines from the end; all by default).
|
|
582
|
+
* @returns The readable stream of the logs.
|
|
583
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
584
|
+
*/
|
|
585
|
+
async logs(options) {
|
|
586
|
+
if (!options)
|
|
587
|
+
return await this.logs({});
|
|
588
|
+
const logs = await this.getClient().containerLogs(this.id, {
|
|
589
|
+
follow: !!options.follow,
|
|
590
|
+
stdout: true,
|
|
591
|
+
stderr: true,
|
|
592
|
+
since: options.since,
|
|
593
|
+
until: options.until,
|
|
594
|
+
timestamps: options.timestamps,
|
|
595
|
+
tail: options.tail
|
|
596
|
+
});
|
|
597
|
+
//The logs of a container without TTY are multiplexed: their contents are given, in their order
|
|
598
|
+
if (this.tty)
|
|
599
|
+
return logs;
|
|
600
|
+
const decoder = new DockerStreams_js_1.DockerStreamDecoder();
|
|
601
|
+
logs.once('error', (error) => decoder.destroy(error));
|
|
602
|
+
return logs.pipe(decoder);
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Read the resource usage of the container once, as `docker stats --no-stream`: CPU, memory, network, block I/O and
|
|
606
|
+
* processes, as the Engine API reports them.
|
|
607
|
+
* @returns The statistics.
|
|
608
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
609
|
+
*/
|
|
610
|
+
async stats() {
|
|
611
|
+
return await this.getClient().containerStats(this.id);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Run a command in the running container, as `docker exec` (no TTY, no stdin), and wait for it to exit. As the
|
|
615
|
+
* containerd component's, a command exiting with a non-zero code resolves too: check its `exitCode`.
|
|
616
|
+
* @param options The command: a program and its arguments (`['ls', '-l']`), run as they are, or a command line
|
|
617
|
+
* (`'ls /data | wc -l'`), run by `/bin/sh -c`.
|
|
618
|
+
* @returns The exit code of the command, its stdout and its stderr (a program not found: exit code `127` or `126`,
|
|
619
|
+
* the error in the output).
|
|
620
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
621
|
+
* @throws {DockerRequestException} When the container is not running or paused (HTTP 409).
|
|
622
|
+
*/
|
|
623
|
+
async exec(options) {
|
|
624
|
+
const exec = await this.getClient().createExec(this.id, {
|
|
625
|
+
Cmd: typeof options.cmd === 'string' ? ['/bin/sh', '-c', options.cmd] : options.cmd,
|
|
626
|
+
AttachStdout: true,
|
|
627
|
+
AttachStderr: true
|
|
628
|
+
});
|
|
629
|
+
//Without TTY, the output is multiplexed: stdout and stderr apart
|
|
630
|
+
const duplex = await this.getClient().startExec(exec.Id, { Detach: false, Tty: false });
|
|
631
|
+
const { stdout, stderr } = await (0, DockerStreams_js_1.readMultiplexed)(duplex);
|
|
632
|
+
//The exit code is set once the process is reaped, which may follow the end of its output
|
|
633
|
+
let inspectInfo = await this.getClient().inspectExec(exec.Id);
|
|
634
|
+
for (let attempt = 0; (inspectInfo.Running || inspectInfo.ExitCode === null) && attempt < 200; attempt++) {
|
|
635
|
+
await (0, promises_1.setTimeout)(10);
|
|
636
|
+
inspectInfo = await this.getClient().inspectExec(exec.Id);
|
|
637
|
+
}
|
|
638
|
+
return { exitCode: inspectInfo.ExitCode ?? 0, stdout: stdout, stderr: stderr };
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Send a signal to the container's main process, as `docker kill` (`SIGKILL` by default), then refresh its properties.
|
|
642
|
+
* @param options The signal sent: a name (`'SIGHUP'`) or a number (`1`); `SIGKILL` by default.
|
|
643
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
644
|
+
* @throws {DockerRequestException} When the container is not running (HTTP 409), or the signal is unknown.
|
|
645
|
+
*/
|
|
646
|
+
async kill(options) {
|
|
647
|
+
if (!options)
|
|
648
|
+
return await this.kill({});
|
|
649
|
+
await this.getClient().killContainer(this.id, { signal: options.signal === undefined ? undefined : String(options.signal) });
|
|
650
|
+
await this.syncContainerInfo();
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Copy a file or a directory out of the container as a tar archive, as `docker cp container:path -`. The container
|
|
654
|
+
* may be stopped.
|
|
655
|
+
* @param options The path in the container, and the `destination` of the archive: a file path (created or
|
|
656
|
+
* overwritten) or a writable stream (ended after the archive).
|
|
657
|
+
* @throws {DockerContainerNotFoundException} When the container was removed.
|
|
658
|
+
* @throws {DockerRequestException} When the path is not found in the container (HTTP 404).
|
|
659
|
+
* @throws {Error} The error of the destination.
|
|
660
|
+
*/
|
|
661
|
+
async exportDirectory(options) {
|
|
662
|
+
const readableStream = await this.getClient().getArchive(this.id, { path: options.path });
|
|
663
|
+
const writableStream = typeof options.destination === 'string' ? (0, node_fs_1.createWriteStream)(options.destination) : options.destination;
|
|
664
|
+
await (0, promises_2.pipeline)(readableStream, writableStream);
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
exports.DockerContainer = DockerContainer;
|
|
668
|
+
__decorate([
|
|
669
|
+
(0, di_1.Configurable)(core_1.DTO.Function()),
|
|
670
|
+
__metadata("design:type", Function)
|
|
671
|
+
], DockerContainer.prototype, "getClient", void 0);
|
|
672
|
+
__decorate([
|
|
673
|
+
(0, di_1.Configurable)(core_1.DTO.Function()),
|
|
674
|
+
__metadata("design:type", Function)
|
|
675
|
+
], DockerContainer.prototype, "getDocker", void 0);
|
|
676
|
+
__decorate([
|
|
677
|
+
(0, di_1.Configurable)(core_1.DTO.String()),
|
|
678
|
+
__metadata("design:type", String)
|
|
679
|
+
], DockerContainer.prototype, "id", void 0);
|
|
680
|
+
__decorate([
|
|
681
|
+
(0, dto_1.Accept)(ContainerStopOptions_js_1.ContainerStopOptions.optional()),
|
|
682
|
+
__metadata("design:type", Function),
|
|
683
|
+
__metadata("design:paramtypes", [ContainerStopOptions_js_1.ContainerStopOptions]),
|
|
684
|
+
__metadata("design:returntype", Promise)
|
|
685
|
+
], DockerContainer.prototype, "stop", null);
|
|
686
|
+
__decorate([
|
|
687
|
+
(0, dto_1.Accept)(ContainerStopOptions_js_1.ContainerStopOptions.optional()),
|
|
688
|
+
__metadata("design:type", Function),
|
|
689
|
+
__metadata("design:paramtypes", [ContainerStopOptions_js_1.ContainerStopOptions]),
|
|
690
|
+
__metadata("design:returntype", Promise)
|
|
691
|
+
], DockerContainer.prototype, "restart", null);
|
|
692
|
+
__decorate([
|
|
693
|
+
(0, dto_1.Accept)(ContainerRemoveOptions_js_1.ContainerRemoveOptions.optional()),
|
|
694
|
+
__metadata("design:type", Function),
|
|
695
|
+
__metadata("design:paramtypes", [ContainerRemoveOptions_js_1.ContainerRemoveOptions]),
|
|
696
|
+
__metadata("design:returntype", Promise)
|
|
697
|
+
], DockerContainer.prototype, "remove", null);
|
|
698
|
+
__decorate([
|
|
699
|
+
(0, dto_1.Accept)(ContainerSettingOptions_js_1.ContainerSettingOptions.required()),
|
|
700
|
+
__metadata("design:type", Function),
|
|
701
|
+
__metadata("design:paramtypes", [ContainerSettingOptions_js_1.ContainerSettingOptions]),
|
|
702
|
+
__metadata("design:returntype", Promise)
|
|
703
|
+
], DockerContainer.prototype, "update", null);
|
|
704
|
+
__decorate([
|
|
705
|
+
(0, dto_1.Accept)(ContainerCommitOptions_js_1.ContainerCommitOptions.optional().default({})),
|
|
706
|
+
__metadata("design:type", Function),
|
|
707
|
+
__metadata("design:paramtypes", [ContainerCommitOptions_js_1.ContainerCommitOptions]),
|
|
708
|
+
__metadata("design:returntype", Promise)
|
|
709
|
+
], DockerContainer.prototype, "commit", null);
|
|
710
|
+
__decorate([
|
|
711
|
+
(0, dto_1.Accept)(ContainerCreateTTYOptions_js_1.ContainerCreateTTYOptions.optional()),
|
|
712
|
+
__metadata("design:type", Function),
|
|
713
|
+
__metadata("design:paramtypes", [ContainerCreateTTYOptions_js_1.ContainerCreateTTYOptions]),
|
|
714
|
+
__metadata("design:returntype", Promise)
|
|
715
|
+
], DockerContainer.prototype, "createTTY", null);
|
|
716
|
+
__decorate([
|
|
717
|
+
(0, dto_1.Accept)(ContainerLogsOptions_js_1.ContainerLogsOptions.optional()),
|
|
718
|
+
__metadata("design:type", Function),
|
|
719
|
+
__metadata("design:paramtypes", [ContainerLogsOptions_js_1.ContainerLogsOptions]),
|
|
720
|
+
__metadata("design:returntype", Promise)
|
|
721
|
+
], DockerContainer.prototype, "logs", null);
|
|
722
|
+
__decorate([
|
|
723
|
+
(0, dto_1.Accept)(ContainerExecOptions_js_1.ContainerExecOptions.required()),
|
|
724
|
+
__metadata("design:type", Function),
|
|
725
|
+
__metadata("design:paramtypes", [ContainerExecOptions_js_1.ContainerExecOptions]),
|
|
726
|
+
__metadata("design:returntype", Promise)
|
|
727
|
+
], DockerContainer.prototype, "exec", null);
|
|
728
|
+
__decorate([
|
|
729
|
+
(0, dto_1.Accept)(ContainerKillOptions_js_1.ContainerKillOptions.optional()),
|
|
730
|
+
__metadata("design:type", Function),
|
|
731
|
+
__metadata("design:paramtypes", [ContainerKillOptions_js_1.ContainerKillOptions]),
|
|
732
|
+
__metadata("design:returntype", Promise)
|
|
733
|
+
], DockerContainer.prototype, "kill", null);
|
|
734
|
+
__decorate([
|
|
735
|
+
(0, dto_1.Accept)(ContainerExportDirectoryOptions_js_1.ContainerExportDirectoryOptions.required()),
|
|
736
|
+
__metadata("design:type", Function),
|
|
737
|
+
__metadata("design:paramtypes", [ContainerExportDirectoryOptions_js_1.ContainerExportDirectoryOptions]),
|
|
738
|
+
__metadata("design:returntype", Promise)
|
|
739
|
+
], DockerContainer.prototype, "exportDirectory", null);
|
|
740
|
+
exports.DockerContainer = DockerContainer = __decorate([
|
|
741
|
+
(0, di_1.Transient)()
|
|
742
|
+
], DockerContainer);
|