@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,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The rules of the .dockerignore files, rewritten from @balena/dockerignore (Copyright 2020 Balena Ltd., Apache License
|
|
3
|
+
* 2.0, and Copyright 2018 Zeit, Inc., MIT License, see THIRD_PARTY_NOTICES.md), which follows the implementation of
|
|
4
|
+
* Docker (moby/moby builder/dockerignore and pkg/fileutils)
|
|
5
|
+
*/
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
/**
|
|
8
|
+
* The separators of the paths of the platform: on Windows, "/" and "\" separate the paths and "\" does not escape
|
|
9
|
+
*/
|
|
10
|
+
const SEPARATOR = path.sep;
|
|
11
|
+
/**
|
|
12
|
+
* filepath.Clean of Go
|
|
13
|
+
* @param file
|
|
14
|
+
*/
|
|
15
|
+
function cleanPath(file) {
|
|
16
|
+
return path.normalize(file).replace(SEPARATOR === '\\' ? /(?<=.)\\$/ : /(?<=.)\/$/, '');
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* filepath.ToSlash of Go
|
|
20
|
+
* @param file
|
|
21
|
+
*/
|
|
22
|
+
function toSlash(file) {
|
|
23
|
+
return SEPARATOR === '/' ? file : file.replace(/\\/g, '/');
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* filepath.FromSlash of Go
|
|
27
|
+
* @param file
|
|
28
|
+
*/
|
|
29
|
+
function fromSlash(file) {
|
|
30
|
+
return SEPARATOR === '/' ? file : file.replace(/\//g, SEPARATOR);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The rules of a .dockerignore file: the files of a build context they exclude
|
|
34
|
+
*/
|
|
35
|
+
export class DockerIgnore {
|
|
36
|
+
#rules = [];
|
|
37
|
+
#cache = new Map();
|
|
38
|
+
/**
|
|
39
|
+
* @param content the content of a .dockerignore file
|
|
40
|
+
* @param ignoreCase match the case-insensitively, as Docker does not (false by default)
|
|
41
|
+
*/
|
|
42
|
+
constructor(content = '', ignoreCase = false) {
|
|
43
|
+
this.ignoreCase = ignoreCase;
|
|
44
|
+
this.add(content);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Add the rules of a content
|
|
48
|
+
* @param content
|
|
49
|
+
*/
|
|
50
|
+
add(content) {
|
|
51
|
+
for (const line of content.split(/\r?\n/)) {
|
|
52
|
+
if (!line.trim() || line.startsWith('#'))
|
|
53
|
+
continue;
|
|
54
|
+
const rule = this.rule(line.trim());
|
|
55
|
+
if (rule)
|
|
56
|
+
this.#rules.push(rule);
|
|
57
|
+
}
|
|
58
|
+
this.#cache.clear();
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A rule of a line (moby/moby builder/dockerignore/dockerignore.go and pkg/fileutils/fileutils.go)
|
|
63
|
+
* @param line
|
|
64
|
+
*/
|
|
65
|
+
rule(line) {
|
|
66
|
+
let pattern = line;
|
|
67
|
+
let negative = false;
|
|
68
|
+
if (pattern.startsWith('!')) {
|
|
69
|
+
negative = true;
|
|
70
|
+
pattern = pattern.substring(1).trim();
|
|
71
|
+
}
|
|
72
|
+
if (pattern.length > 0) {
|
|
73
|
+
pattern = toSlash(cleanPath(pattern));
|
|
74
|
+
if (pattern.length > 1 && pattern.startsWith('/'))
|
|
75
|
+
pattern = pattern.slice(1);
|
|
76
|
+
}
|
|
77
|
+
if (negative)
|
|
78
|
+
pattern = `!${pattern}`;
|
|
79
|
+
pattern = pattern.trim();
|
|
80
|
+
if (!pattern)
|
|
81
|
+
return undefined;
|
|
82
|
+
pattern = cleanPath(pattern);
|
|
83
|
+
if (pattern.startsWith('!')) {
|
|
84
|
+
if (pattern.length === 1)
|
|
85
|
+
return undefined;
|
|
86
|
+
negative = true;
|
|
87
|
+
pattern = pattern.substring(1);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
negative = false;
|
|
91
|
+
}
|
|
92
|
+
return { pattern: pattern, directories: pattern.split(SEPARATOR), negative: negative };
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The regular expression of a rule (fileutils.go regexpMatch)
|
|
96
|
+
* @param rule
|
|
97
|
+
*/
|
|
98
|
+
expression(rule) {
|
|
99
|
+
if (rule.expression)
|
|
100
|
+
return rule.expression;
|
|
101
|
+
const separator = SEPARATOR === '\\' ? '\\\\' : SEPARATOR;
|
|
102
|
+
let source = '^';
|
|
103
|
+
const pattern = rule.pattern;
|
|
104
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
105
|
+
const character = pattern[index];
|
|
106
|
+
if (character === '*') {
|
|
107
|
+
if (pattern[index + 1] === '*') {
|
|
108
|
+
index++;
|
|
109
|
+
//"**/" is "**"
|
|
110
|
+
if (pattern[index + 1] === SEPARATOR)
|
|
111
|
+
index++;
|
|
112
|
+
source += pattern[index + 1] === undefined ? '.*' : `(.*${separator})?`;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
source += `[^${separator}]*`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else if (character === '?') {
|
|
119
|
+
source += `[^${separator}]`;
|
|
120
|
+
}
|
|
121
|
+
else if (character === '.' || character === '$') {
|
|
122
|
+
source += `\\${character}`;
|
|
123
|
+
}
|
|
124
|
+
else if (character === '\\') {
|
|
125
|
+
if (SEPARATOR === '\\') {
|
|
126
|
+
source += separator;
|
|
127
|
+
}
|
|
128
|
+
else if (pattern[index + 1] !== undefined) {
|
|
129
|
+
source += `\\${pattern[++index]}`;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
source += '\\';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
source += character;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return rule.expression = new RegExp(`${source}$`, this.ignoreCase ? 'i' : '');
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Whether a file of the context is excluded by the rules (its path relative to the context, "/" separated)
|
|
143
|
+
* @param file
|
|
144
|
+
*/
|
|
145
|
+
ignores(file) {
|
|
146
|
+
if (!file)
|
|
147
|
+
return true;
|
|
148
|
+
let ignored = this.#cache.get(file);
|
|
149
|
+
if (ignored === undefined)
|
|
150
|
+
this.#cache.set(file, ignored = this.test(file));
|
|
151
|
+
return ignored;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Whether a file is excluded: the last rule matching it or one of its parent directories decides
|
|
155
|
+
* @param file
|
|
156
|
+
*/
|
|
157
|
+
test(file) {
|
|
158
|
+
const local = fromSlash(file);
|
|
159
|
+
const parent = cleanPath(path.dirname(local));
|
|
160
|
+
const parentDirectories = parent.split(SEPARATOR);
|
|
161
|
+
let matched = false;
|
|
162
|
+
for (const rule of this.#rules) {
|
|
163
|
+
let match = this.expression(rule).test(local);
|
|
164
|
+
if (!match && parent !== '.') {
|
|
165
|
+
if (rule.directories.includes('**')) {
|
|
166
|
+
for (let index = rule.directories.filter((directory) => directory !== '**').length; index <= parentDirectories.length; index++) {
|
|
167
|
+
match = match || this.expression(rule).test(parentDirectories.slice(0, index).join(SEPARATOR));
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (rule.directories.length <= parentDirectories.length) {
|
|
171
|
+
match = this.expression(rule).test(parentDirectories.slice(0, rule.directories.length).join(SEPARATOR));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (match)
|
|
175
|
+
matched = !rule.negative;
|
|
176
|
+
}
|
|
177
|
+
return matched;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 class DockerRequestError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* @param statusCode the status of the response
|
|
8
|
+
* @param reason the meaning of the status for the request
|
|
9
|
+
* @param detail the message of the daemon
|
|
10
|
+
* @param json the body of the response
|
|
11
|
+
*/
|
|
12
|
+
constructor(statusCode, reason, detail, json) {
|
|
13
|
+
super(`(HTTP code ${statusCode}) ${reason} - ${detail} `);
|
|
14
|
+
this.statusCode = statusCode;
|
|
15
|
+
this.reason = reason;
|
|
16
|
+
this.detail = detail;
|
|
17
|
+
this.json = json;
|
|
18
|
+
this.name = 'DockerRequestError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The streams of the Docker Engine API, rewritten from docker-modem (Copyright Pedro Dias, Apache License 2.0, see
|
|
3
|
+
* THIRD_PARTY_NOTICES.md): the multiplexed output of the containers without TTY, and the JSON lines of the progresses
|
|
4
|
+
*/
|
|
5
|
+
import { Transform } from 'node:stream';
|
|
6
|
+
/**
|
|
7
|
+
* The stream of a frame of a multiplexed output
|
|
8
|
+
*/
|
|
9
|
+
export var DockerStreamType;
|
|
10
|
+
(function (DockerStreamType) {
|
|
11
|
+
DockerStreamType[DockerStreamType["STDIN"] = 0] = "STDIN";
|
|
12
|
+
DockerStreamType[DockerStreamType["STDOUT"] = 1] = "STDOUT";
|
|
13
|
+
DockerStreamType[DockerStreamType["STDERR"] = 2] = "STDERR";
|
|
14
|
+
})(DockerStreamType || (DockerStreamType = {}));
|
|
15
|
+
/**
|
|
16
|
+
* The output of a container without TTY is multiplexed: each frame is a header of 8 bytes (the stream, 3 zeros, the
|
|
17
|
+
* size as a big endian uint32) and its content. The decoder gives the contents, in their order; its "frame" event
|
|
18
|
+
* gives each content with its stream
|
|
19
|
+
*/
|
|
20
|
+
export class DockerStreamDecoder extends Transform {
|
|
21
|
+
#pending = Buffer.alloc(0);
|
|
22
|
+
_transform(chunk, _encoding, callback) {
|
|
23
|
+
this.#pending = this.#pending.length ? Buffer.concat([this.#pending, chunk]) : chunk;
|
|
24
|
+
while (this.#pending.length >= 8) {
|
|
25
|
+
const size = this.#pending.readUInt32BE(4);
|
|
26
|
+
if (this.#pending.length < 8 + size)
|
|
27
|
+
break;
|
|
28
|
+
const type = this.#pending.readUInt8(0);
|
|
29
|
+
const content = this.#pending.subarray(8, 8 + size);
|
|
30
|
+
this.#pending = this.#pending.subarray(8 + size);
|
|
31
|
+
if (content.length) {
|
|
32
|
+
this.emit('frame', type, content);
|
|
33
|
+
this.push(content);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
callback();
|
|
37
|
+
}
|
|
38
|
+
_flush(callback) {
|
|
39
|
+
//A truncated frame is given as it is
|
|
40
|
+
if (this.#pending.length)
|
|
41
|
+
this.push(this.#pending);
|
|
42
|
+
callback();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The output of a multiplexed stream (or buffer), and its outputs by stream
|
|
47
|
+
* @param input
|
|
48
|
+
*/
|
|
49
|
+
export async function readMultiplexed(input) {
|
|
50
|
+
const decoder = new DockerStreamDecoder();
|
|
51
|
+
const output = [];
|
|
52
|
+
const streams = { [DockerStreamType.STDOUT]: [], [DockerStreamType.STDERR]: [] };
|
|
53
|
+
decoder.on('frame', (type, content) => (streams[type] ??= []).push(content));
|
|
54
|
+
decoder.on('data', (content) => output.push(content));
|
|
55
|
+
await new Promise((resolve, reject) => {
|
|
56
|
+
decoder.once('end', resolve).once('error', reject);
|
|
57
|
+
if (Buffer.isBuffer(input)) {
|
|
58
|
+
decoder.end(input);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
input.once('error', (error) => decoder.destroy(error));
|
|
62
|
+
input.pipe(decoder);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
output: Buffer.concat(output).toString(),
|
|
67
|
+
stdout: Buffer.concat(streams[DockerStreamType.STDOUT]).toString(),
|
|
68
|
+
stderr: Buffer.concat(streams[DockerStreamType.STDERR]).toString()
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 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
|
|
73
|
+
* are given back once the stream ends. The lines which are not JSON are skipped
|
|
74
|
+
* @param input
|
|
75
|
+
* @param onProgress
|
|
76
|
+
*/
|
|
77
|
+
export async function followProgress(input, onProgress) {
|
|
78
|
+
const objects = [];
|
|
79
|
+
let pending = '';
|
|
80
|
+
const line = (text) => {
|
|
81
|
+
const trimmed = text.trim();
|
|
82
|
+
if (!trimmed)
|
|
83
|
+
return;
|
|
84
|
+
let object;
|
|
85
|
+
try {
|
|
86
|
+
object = JSON.parse(trimmed);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
objects.push(object);
|
|
92
|
+
onProgress?.(object);
|
|
93
|
+
};
|
|
94
|
+
await new Promise((resolve, reject) => {
|
|
95
|
+
input.on('data', (chunk) => {
|
|
96
|
+
pending += chunk.toString();
|
|
97
|
+
let position;
|
|
98
|
+
while ((position = pending.indexOf('\n')) >= 0) {
|
|
99
|
+
line(pending.slice(0, position));
|
|
100
|
+
pending = pending.slice(position + 1);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
input.once('end', () => {
|
|
104
|
+
line(pending);
|
|
105
|
+
resolve();
|
|
106
|
+
});
|
|
107
|
+
input.once('close', resolve);
|
|
108
|
+
input.once('error', reject);
|
|
109
|
+
});
|
|
110
|
+
return objects;
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Docker } from './Docker.js';
|
|
2
|
+
/**
|
|
3
|
+
* Build the component options of a {@link Docker} connected as the options say, to register it in the `components` of
|
|
4
|
+
* an application under the name of your choice. Without `socketPath` nor `host`, it connects to the Docker of the
|
|
5
|
+
* environment (`DOCKER_HOST`, else the local socket). The options are validated when the component is created, not
|
|
6
|
+
* here.
|
|
7
|
+
* @param options The connection options: a socket (`socketPath`), or a `host` and `port` reached with `protocol`
|
|
8
|
+
* (`'http'`, `'https'` or `'ssh'`), with their TLS, SSH, timeout and API version options.
|
|
9
|
+
* @returns The component options (`{class: Docker, ...options}`).
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import {Application} from 'lakutata'
|
|
13
|
+
* import {buildDockerConnectionOptions} from 'lakutata/com/docker'
|
|
14
|
+
*
|
|
15
|
+
* Application.run(() => ({
|
|
16
|
+
* id: 'docker.app',
|
|
17
|
+
* name: 'Docker',
|
|
18
|
+
* components: {
|
|
19
|
+
* //The Docker of the environment (DOCKER_HOST, else the local socket), with the API version 1.47
|
|
20
|
+
* docker: buildDockerConnectionOptions({version: '1.47'})
|
|
21
|
+
* }
|
|
22
|
+
* }))
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const buildDockerConnectionOptions = (options) => ({
|
|
26
|
+
...options,
|
|
27
|
+
class: Docker
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Build the component options of a {@link Docker} connected to the Unix socket of a daemon (or its named pipe on
|
|
31
|
+
* Windows), to register it in the `components` of an application. The options are validated when the component is
|
|
32
|
+
* created, not here.
|
|
33
|
+
* @param options The path of the socket (`socketPath`), with the timeout and the API version. Without `socketPath`, the
|
|
34
|
+
* Docker of the environment is used, with the other options applied over it.
|
|
35
|
+
* @returns The component options (`{class: Docker, ...options}`).
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* import {Application} from 'lakutata'
|
|
39
|
+
* import {buildDockerSocketConnectionOptions} from 'lakutata/com/docker'
|
|
40
|
+
*
|
|
41
|
+
* Application.run(() => ({
|
|
42
|
+
* id: 'docker.app',
|
|
43
|
+
* name: 'Docker',
|
|
44
|
+
* components: {
|
|
45
|
+
* docker: buildDockerSocketConnectionOptions({socketPath: '/var/run/docker.sock', timeout: 60000})
|
|
46
|
+
* }
|
|
47
|
+
* }))
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export const buildDockerSocketConnectionOptions = (options) => ({
|
|
51
|
+
...options,
|
|
52
|
+
class: Docker
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Build the component options of a {@link Docker} connected to a daemon over plain HTTP (`dockerd -H tcp://0.0.0.0:2375`),
|
|
56
|
+
* to register it in the `components` of an application. The connection is neither encrypted nor authenticated: keep it
|
|
57
|
+
* to trusted networks. The options are validated when the component is created, not here.
|
|
58
|
+
* @param options The `host` and `port` of the daemon, with the headers, the timeout and the API version; the `protocol`
|
|
59
|
+
* is set to `'http'`.
|
|
60
|
+
* @returns The component options (`{class: Docker, protocol: 'http', ...options}`).
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* import {Application} from 'lakutata'
|
|
64
|
+
* import {buildDockerHttpConnectionOptions} from 'lakutata/com/docker'
|
|
65
|
+
*
|
|
66
|
+
* Application.run(() => ({
|
|
67
|
+
* id: 'docker.app',
|
|
68
|
+
* name: 'Docker',
|
|
69
|
+
* components: {
|
|
70
|
+
* docker: buildDockerHttpConnectionOptions({host: '192.168.1.10', port: 2375})
|
|
71
|
+
* }
|
|
72
|
+
* }))
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export const buildDockerHttpConnectionOptions = (options) => ({
|
|
76
|
+
...options,
|
|
77
|
+
protocol: 'http',
|
|
78
|
+
class: Docker
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Build the component options of a {@link Docker} connected to a daemon over HTTPS (`dockerd --tlsverify -H
|
|
82
|
+
* tcp://0.0.0.0:2376`), to register it in the `components` of an application. The options are validated when the
|
|
83
|
+
* component is created, not here.
|
|
84
|
+
* @param options The `host` and `port` of the daemon, with the PEM contents of the authority (`ca`), the client
|
|
85
|
+
* certificate (`cert`) and its key (`key`), the headers, the timeout and the API version; the `protocol` is set to
|
|
86
|
+
* `'https'`.
|
|
87
|
+
* @returns The component options (`{class: Docker, protocol: 'https', ...options}`).
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* import {readFileSync} from 'node:fs'
|
|
91
|
+
* import {Application} from 'lakutata'
|
|
92
|
+
* import {buildDockerHttpsConnectionOptions} from 'lakutata/com/docker'
|
|
93
|
+
*
|
|
94
|
+
* Application.run(() => ({
|
|
95
|
+
* id: 'docker.app',
|
|
96
|
+
* name: 'Docker',
|
|
97
|
+
* components: {
|
|
98
|
+
* //The PEM contents, not the file paths
|
|
99
|
+
* docker: buildDockerHttpsConnectionOptions({
|
|
100
|
+
* host: 'docker.example.com',
|
|
101
|
+
* port: 2376,
|
|
102
|
+
* ca: readFileSync('/etc/docker/certs/ca.pem'),
|
|
103
|
+
* cert: readFileSync('/etc/docker/certs/cert.pem'),
|
|
104
|
+
* key: readFileSync('/etc/docker/certs/key.pem')
|
|
105
|
+
* })
|
|
106
|
+
* }
|
|
107
|
+
* }))
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
export const buildDockerHttpsConnectionOptions = (options) => ({
|
|
111
|
+
...options,
|
|
112
|
+
protocol: 'https',
|
|
113
|
+
class: Docker
|
|
114
|
+
});
|
|
115
|
+
/**
|
|
116
|
+
* Build the component options of a {@link Docker} connected to a remote daemon over SSH, as `DOCKER_HOST=ssh://user@host`
|
|
117
|
+
* does, to register it in the `components` of an application. The requests go through `docker system dial-stdio` run on
|
|
118
|
+
* the remote host, which needs the Docker CLI; locally, the optional package `ssh2` must be installed. The SSH connection
|
|
119
|
+
* authenticates through the SSH agent (no password). The options are validated when the component is created, not here.
|
|
120
|
+
* @param options The `host` and `port` (the SSH port, usually 22) of the remote host, the `username`, the SSH agent's
|
|
121
|
+
* socket (`sshAuthAgent`; `SSH_AUTH_SOCK` by default), the timeout and the API version; the `protocol` is set to
|
|
122
|
+
* `'ssh'`.
|
|
123
|
+
* @returns The component options (`{class: Docker, protocol: 'ssh', ...options}`).
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import {Application} from 'lakutata'
|
|
127
|
+
* import {buildDockerSSHConnectionOptions} from 'lakutata/com/docker'
|
|
128
|
+
*
|
|
129
|
+
* Application.run(() => ({
|
|
130
|
+
* id: 'docker.app',
|
|
131
|
+
* name: 'Docker',
|
|
132
|
+
* components: {
|
|
133
|
+
* docker: buildDockerSSHConnectionOptions({host: 'docker.example.com', port: 22, username: 'deploy'})
|
|
134
|
+
* }
|
|
135
|
+
* }))
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export const buildDockerSSHConnectionOptions = (options) => ({
|
|
139
|
+
...options,
|
|
140
|
+
protocol: 'ssh',
|
|
141
|
+
class: Docker
|
|
142
|
+
});
|