@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,33 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How `DockerImage.export()` saves an image as a tar archive (`docker save`), which {@link Docker.importImage} or
|
|
4
|
+
* `docker load` loads back. `destination` is required.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
8
|
+
*
|
|
9
|
+
* declare const docker: Docker
|
|
10
|
+
*
|
|
11
|
+
* const image = await docker.getImage('api:1.4.0')
|
|
12
|
+
* //Loaded back as api:stable
|
|
13
|
+
* await image.export({destination: '/backup/api.tar', repoTag: 'api:stable'})
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class ImageExportOptions extends DTO {
|
|
17
|
+
/**
|
|
18
|
+
* Where the archive is written: the path of a file, created or replaced, or a writable stream, ended once the
|
|
19
|
+
* archive is written. Required.
|
|
20
|
+
*/
|
|
21
|
+
destination: string | NodeJS.WritableStream;
|
|
22
|
+
/**
|
|
23
|
+
* The `repo:tag` the archive names the image with, which the image gets back when loaded (`api:1.4.0`). Without it,
|
|
24
|
+
* the image is saved by its ID: it is loaded back without a name.
|
|
25
|
+
*/
|
|
26
|
+
repoTag?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Tag the image with `repoTag` first when it does not have it; `false` fails the export with
|
|
29
|
+
* `DockerImageRepoTagNotFoundException` instead.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
createRepoTagIfNotExists?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How {@link Docker.importImage} loads an image from a tar archive made by `DockerImage.export()` or `docker save`
|
|
4
|
+
* (`docker load`), the loaded image returned. `source` is required.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* import {createReadStream} from 'node:fs'
|
|
8
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
9
|
+
*
|
|
10
|
+
* declare const docker: Docker
|
|
11
|
+
*
|
|
12
|
+
* const image = await docker.importImage({source: '/backup/api.tar'})
|
|
13
|
+
* //Or from a stream: an upload, a download
|
|
14
|
+
* const copy = await docker.importImage({source: createReadStream('/backup/api.tar')})
|
|
15
|
+
* console.log(image.repoTags, copy.id)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ImageImportOptions extends DTO {
|
|
19
|
+
/**
|
|
20
|
+
* The archive: the path of a file, or a readable stream of it. Required.
|
|
21
|
+
*/
|
|
22
|
+
source: string | NodeJS.ReadableStream;
|
|
23
|
+
/**
|
|
24
|
+
* Have Docker report no progress while it loads the archive (`docker load --quiet`).
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
quiet?: boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { DockerAuthOptions } from '../auth/DockerAuthOptions.js';
|
|
3
|
+
import type { DockerOutputCallback } from '../../types/DockerOutputCallback.js';
|
|
4
|
+
/**
|
|
5
|
+
* Which image {@link Docker.pullImage} pulls from its registry (`docker pull`), the pulled image returned. `repo` is
|
|
6
|
+
* required.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
10
|
+
*
|
|
11
|
+
* declare const docker: Docker
|
|
12
|
+
*
|
|
13
|
+
* const nginx = await docker.pullImage({repo: 'nginx', tag: '1.27-alpine'})
|
|
14
|
+
* const app = await docker.pullImage({
|
|
15
|
+
* repo: 'registry.example.com:5000/team/app',
|
|
16
|
+
* tag: '2.1.0',
|
|
17
|
+
* platform: 'linux/arm64',
|
|
18
|
+
* auth: {serverAddress: 'registry.example.com:5000', username: 'ci', password: process.env.REGISTRY_PASSWORD ?? ''},
|
|
19
|
+
* outputCallback: (output: Record<string, any>): void => console.log(output.status, output.id ?? '')
|
|
20
|
+
* })
|
|
21
|
+
* console.log(nginx.id, app.id)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ImagePullOptions extends DTO {
|
|
25
|
+
/**
|
|
26
|
+
* The repository, with its registry when it is not Docker Hub (`nginx`, `bitnami/redis`,
|
|
27
|
+
* `registry.example.com:5000/team/app`), without the tag. Required.
|
|
28
|
+
*/
|
|
29
|
+
repo: string;
|
|
30
|
+
/**
|
|
31
|
+
* The tag pulled (`1.27-alpine`).
|
|
32
|
+
* @default 'latest'
|
|
33
|
+
*/
|
|
34
|
+
tag?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The platform pulled from a multi-platform image, `os[/arch[/variant]]` (`linux/arm64`); the Docker host's
|
|
37
|
+
* platform when absent.
|
|
38
|
+
*/
|
|
39
|
+
platform?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The credentials of a private registry; all of them are sent, the tokens included.
|
|
42
|
+
*/
|
|
43
|
+
auth?: DockerAuthOptions;
|
|
44
|
+
/**
|
|
45
|
+
* Receive the pull progress as Docker sends it (`{status: 'Downloading', id: '<layer>', progressDetail: {current,
|
|
46
|
+
* total}}`).
|
|
47
|
+
*/
|
|
48
|
+
outputCallback?: DockerOutputCallback;
|
|
49
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { DockerAuthOptions } from '../auth/DockerAuthOptions.js';
|
|
3
|
+
import { type DockerOutputCallback } from '../../types/DockerOutputCallback.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where `DockerImage.push()` pushes an image (`docker push`): the image is tagged `repo:tag` first, then pushed to the
|
|
6
|
+
* registry of `repo`. `repo` is required.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
10
|
+
*
|
|
11
|
+
* declare const docker: Docker
|
|
12
|
+
*
|
|
13
|
+
* const image = await docker.getImage('api:1.4.0')
|
|
14
|
+
* await image.push({
|
|
15
|
+
* repo: 'registry.example.com:5000/team/api',
|
|
16
|
+
* tag: '1.4.0',
|
|
17
|
+
* auth: {serverAddress: 'registry.example.com:5000', username: 'ci', password: process.env.REGISTRY_PASSWORD ?? ''}
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ImagePushOptions extends DTO {
|
|
22
|
+
/**
|
|
23
|
+
* The repository pushed to, with its registry when it is not Docker Hub (`registry.example.com:5000/team/api`,
|
|
24
|
+
* `myuser/api`), without the tag. Required.
|
|
25
|
+
*/
|
|
26
|
+
repo: string;
|
|
27
|
+
/**
|
|
28
|
+
* The tag pushed (`1.4.0`).
|
|
29
|
+
* @default 'latest'
|
|
30
|
+
*/
|
|
31
|
+
tag?: string;
|
|
32
|
+
/**
|
|
33
|
+
* The credentials of the registry; all of them are sent, the tokens included.
|
|
34
|
+
*/
|
|
35
|
+
auth?: DockerAuthOptions;
|
|
36
|
+
/**
|
|
37
|
+
* Receive the push progress as Docker sends it (`{status: 'Pushing', id: '<layer>', progressDetail: {current,
|
|
38
|
+
* total}}`).
|
|
39
|
+
*/
|
|
40
|
+
outputCallback?: DockerOutputCallback;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* How `DockerImage.remove()` removes an image by its ID (`docker rmi`).
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
7
|
+
*
|
|
8
|
+
* declare const docker: Docker
|
|
9
|
+
*
|
|
10
|
+
* const image = await docker.getImage('api:1.3.0')
|
|
11
|
+
* //Fails when a container uses the image
|
|
12
|
+
* await image.remove({force: false})
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class ImageRemoveOptions extends DTO {
|
|
16
|
+
/**
|
|
17
|
+
* Remove the image even when it has several tags or stopped containers use it (`docker rmi --force`); `false`
|
|
18
|
+
* fails the removal in these cases. A running container's image is not removed.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
force?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Keep the untagged parent images (`docker rmi --no-prune`); they are removed with the image when absent.
|
|
24
|
+
*/
|
|
25
|
+
noprune?: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
/**
|
|
3
|
+
* The name `DockerImage.tag()` gives an image (`docker tag`), in addition to its other ones. `repo` is required.
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
7
|
+
*
|
|
8
|
+
* declare const docker: Docker
|
|
9
|
+
*
|
|
10
|
+
* const image = await docker.getImage('api:1.4.0')
|
|
11
|
+
* await image.tag({repo: 'registry.example.com:5000/team/api', tag: 'stable'})
|
|
12
|
+
* console.log(image.repoTags)
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare class ImageTagOptions extends DTO {
|
|
16
|
+
/**
|
|
17
|
+
* The repository, with its registry when it is not Docker Hub (`someuser/someimage`,
|
|
18
|
+
* `registry.example.com:5000/team/api`). Required.
|
|
19
|
+
*/
|
|
20
|
+
repo: string;
|
|
21
|
+
/**
|
|
22
|
+
* The tag (`stable`); Docker uses `latest` when absent.
|
|
23
|
+
*/
|
|
24
|
+
tag?: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DTO } from '@lakutata/core';
|
|
2
|
+
import { NetworkIPAMConfig } from '../../types/NetworkInfo.js';
|
|
3
|
+
/**
|
|
4
|
+
* The network {@link Docker.createNetwork} creates (`docker network create`), the created network returned. Only `name`
|
|
5
|
+
* is required.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import {Docker} from 'lakutata/com/docker'
|
|
9
|
+
*
|
|
10
|
+
* declare const docker: Docker
|
|
11
|
+
*
|
|
12
|
+
* const network = await docker.createNetwork({
|
|
13
|
+
* name: 'back',
|
|
14
|
+
* internal: true,
|
|
15
|
+
* NetworkIPAMConfigs: [{subnet: '172.28.0.0/16', range: '172.28.5.0/24', gateway: '172.28.0.1'}]
|
|
16
|
+
* })
|
|
17
|
+
* //Its containers get their addresses from 172.28.5.0/24, or the static ones given to their settings
|
|
18
|
+
* console.log(network.id)
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class NetworkCreateOptions extends DTO {
|
|
22
|
+
/**
|
|
23
|
+
* The network name, unique on the Docker host. Required.
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* The driver's options, by name (`{'com.docker.network.bridge.name': 'br-back'}` for `bridge`,
|
|
28
|
+
* `{parent: 'eth0'}` for `macvlan` and `ipvlan`).
|
|
29
|
+
* @default {}
|
|
30
|
+
*/
|
|
31
|
+
options?: Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* The network driver: `'bridge'`, `'ipvlan'` or `'macvlan'`; another value fails the validation.
|
|
34
|
+
* @default 'bridge'
|
|
35
|
+
*/
|
|
36
|
+
driver?: 'bridge' | 'ipvlan' | 'macvlan';
|
|
37
|
+
/**
|
|
38
|
+
* The network's address ranges, each one required to have its `subnet` (in CIDR notation) and its `gateway` (an
|
|
39
|
+
* address without a prefix length), its `range` optional (in CIDR notation); a value in another notation fails the
|
|
40
|
+
* validation. Empty or absent for a subnet Docker chooses. Its name is in PascalCase, unlike the other options.
|
|
41
|
+
* @default []
|
|
42
|
+
*/
|
|
43
|
+
NetworkIPAMConfigs?: NetworkIPAMConfig[];
|
|
44
|
+
/**
|
|
45
|
+
* Isolate the network from the outside (`docker network create --internal`): its containers reach each other, not
|
|
46
|
+
* the host's networks nor the Internet.
|
|
47
|
+
*/
|
|
48
|
+
internal?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enable IPv6 on the network (`docker network create --ipv6`); give it an IPv6 subnet in `NetworkIPAMConfigs`, or
|
|
51
|
+
* Docker allocates one from its default pools when configured.
|
|
52
|
+
*/
|
|
53
|
+
enableIPv6?: boolean;
|
|
54
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A bind mount of a container: a host file or directory mounted into the container. Read from the container's bind
|
|
3
|
+
* mounts (`DockerContainer.binds`, the named and anonymous volumes excluded), and given to
|
|
4
|
+
* {@link ContainerSettingOptions.binds}, sent to Docker as `"hostPath:containerPath:rw"` or `"hostPath:containerPath:ro"`.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerBind = {
|
|
7
|
+
/**
|
|
8
|
+
* The absolute path of the file or directory on the host (`/srv/app/data`).
|
|
9
|
+
*/
|
|
10
|
+
hostPath: string;
|
|
11
|
+
/**
|
|
12
|
+
* The absolute path where it is mounted in the container (`/data`).
|
|
13
|
+
*/
|
|
14
|
+
containerPath: string;
|
|
15
|
+
/**
|
|
16
|
+
* `true` when the container can write to it, `false` when it is mounted read-only.
|
|
17
|
+
*/
|
|
18
|
+
rw: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Linux capabilities a container's processes can be given, by their names without the `CAP_` prefix (see
|
|
3
|
+
* capabilities(7)), for {@link ContainerSettingOptions.capabilities} (`docker run --cap-add`). Docker grants a default
|
|
4
|
+
* set already (`CHOWN`, `DAC_OVERRIDE`, `FOWNER`, `FSETID`, `KILL`, `SETGID`, `SETUID`, `SETPCAP`, `NET_BIND_SERVICE`,
|
|
5
|
+
* `NET_RAW`, `SYS_CHROOT`, `MKNOD`, `AUDIT_WRITE`, `SETFCAP`); a privileged container has them all.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ContainerCapability {
|
|
8
|
+
/**
|
|
9
|
+
* Enable and disable kernel auditing; change auditing filter rules; retrieve auditing status and filtering rules.
|
|
10
|
+
* (since Linux 2.6.11)
|
|
11
|
+
*/
|
|
12
|
+
AUDIT_CONTROL = "AUDIT_CONTROL",
|
|
13
|
+
/**
|
|
14
|
+
* Allow reading the audit log via a multicast netlink socket.
|
|
15
|
+
* (since Linux 3.16)
|
|
16
|
+
*/
|
|
17
|
+
AUDIT_READ = "AUDIT_READ",
|
|
18
|
+
/**
|
|
19
|
+
* Write records to kernel auditing log.
|
|
20
|
+
* (since Linux 2.6.11)
|
|
21
|
+
*/
|
|
22
|
+
AUDIT_WRITE = "AUDIT_WRITE",
|
|
23
|
+
/**
|
|
24
|
+
* Employ features that can block system suspend (epoll(7) EPOLLWAKEUP, /proc/sys/wake_lock).
|
|
25
|
+
* (since Linux 3.5)
|
|
26
|
+
*/
|
|
27
|
+
BLOCK_SUSPEND = "BLOCK_SUSPEND",
|
|
28
|
+
/**
|
|
29
|
+
* Employ privileged BPF operations; see bpf(2) and bpf-helpers(7).
|
|
30
|
+
* This capability was added in Linux 5.8 to separate out BPF functionality from the overloaded CAP_SYS_ADMIN capability.
|
|
31
|
+
* (since Linux 5.8)
|
|
32
|
+
*/
|
|
33
|
+
BPF = "BPF",
|
|
34
|
+
/**
|
|
35
|
+
* • Update /proc/sys/kernel/ns_last_pid (see pid_namespaces(7));
|
|
36
|
+
* • employ the set_tid feature of clone3(2);
|
|
37
|
+
* • read the contents of the symbolic links in /proc/pid/map_files for other processes.
|
|
38
|
+
* This capability was added in Linux 5.9 to separate out checkpoint/restore functionality from the overloaded CAP_SYS_ADMIN capability.
|
|
39
|
+
* (since Linux 5.9)
|
|
40
|
+
*/
|
|
41
|
+
CHECKPOINT_RESTORE = "CHECKPOINT_RESTORE",
|
|
42
|
+
/**
|
|
43
|
+
* Make arbitrary changes to file UIDs and GIDs (see chown(2)).
|
|
44
|
+
*/
|
|
45
|
+
CHOWN = "CHOWN",
|
|
46
|
+
/**
|
|
47
|
+
* Bypass file read, write, and execute permission checks. (DAC is an abbreviation of "discretionary access control".)
|
|
48
|
+
*/
|
|
49
|
+
DAC_OVERRIDE = "DAC_OVERRIDE",
|
|
50
|
+
/**
|
|
51
|
+
* • Bypass file read permission checks and directory read and execute permission checks;
|
|
52
|
+
* • invoke open_by_handle_at(2);
|
|
53
|
+
* • use the linkat(2) AT_EMPTY_PATH flag to create a link to a file referred to by a file descriptor.
|
|
54
|
+
*/
|
|
55
|
+
DAC_READ_SEARCH = "DAC_READ_SEARCH",
|
|
56
|
+
/**
|
|
57
|
+
* • Bypass permission checks on operations that normally require the filesystem UID of the process to match the UID of the file (e.g., chmod(2), utime(2)), excluding those operations covered by CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH;
|
|
58
|
+
* • set inode flags (see ioctl_iflags(2)) on arbitrary files;
|
|
59
|
+
* • set Access Control Lists (ACLs) on arbitrary files;
|
|
60
|
+
* • ignore directory sticky bit on file deletion;
|
|
61
|
+
* • modify user extended attributes on sticky directory owned by any user;
|
|
62
|
+
* • specify O_NOATIME for arbitrary files in open(2) and fcntl(2).
|
|
63
|
+
*/
|
|
64
|
+
FOWNER = "FOWNER",
|
|
65
|
+
/**
|
|
66
|
+
* • Don't clear set-user-ID and set-group-ID mode bits when a file is modified;
|
|
67
|
+
* • set the set-group-ID bit for a file whose GID does not match the filesystem or any of the supplementary GIDs of the calling process.
|
|
68
|
+
*/
|
|
69
|
+
FSETID = "FSETID",
|
|
70
|
+
/**
|
|
71
|
+
* • Lock memory (mlock(2), mlockall(2), mmap(2), shmctl(2));
|
|
72
|
+
* • Allocate memory using huge pages (memfd_create(2), mmap(2), shmctl(2)).
|
|
73
|
+
*/
|
|
74
|
+
IPC_LOCK = "IPC_LOCK",
|
|
75
|
+
/**
|
|
76
|
+
* Bypass permission checks for operations on System V IPC objects.
|
|
77
|
+
*/
|
|
78
|
+
IPC_OWNER = "IPC_OWNER",
|
|
79
|
+
/**
|
|
80
|
+
* Bypass permission checks for sending signals (see kill(2)). This includes use of the ioctl(2) KDSIGACCEPT operation.
|
|
81
|
+
*/
|
|
82
|
+
KILL = "KILL",
|
|
83
|
+
/**
|
|
84
|
+
* Establish leases on arbitrary files (see fcntl(2)).
|
|
85
|
+
* (since Linux 2.4)
|
|
86
|
+
*/
|
|
87
|
+
LEASE = "LEASE",
|
|
88
|
+
/**
|
|
89
|
+
* Set the FS_APPEND_FL and FS_IMMUTABLE_FL inode flags (see ioctl_iflags(2)).
|
|
90
|
+
*/
|
|
91
|
+
LINUX_IMMUTABLE = "LINUX_IMMUTABLE",
|
|
92
|
+
/**
|
|
93
|
+
* Allow MAC configuration or state changes. Implemented for the Smack Linux Security Module (LSM).
|
|
94
|
+
* (since Linux 2.6.25)
|
|
95
|
+
*/
|
|
96
|
+
MAC_ADMIN = "MAC_ADMIN",
|
|
97
|
+
/**
|
|
98
|
+
* Override Mandatory Access Control (MAC). Implemented for the Smack LSM.
|
|
99
|
+
* (since Linux 2.6.25)
|
|
100
|
+
*/
|
|
101
|
+
MAC_OVERRIDE = "MAC_OVERRIDE",
|
|
102
|
+
/**
|
|
103
|
+
* Create special files using mknod(2).
|
|
104
|
+
* (since Linux 2.4)
|
|
105
|
+
*/
|
|
106
|
+
MKNOD = "MKNOD",
|
|
107
|
+
/**
|
|
108
|
+
* Perform various network-related operations:
|
|
109
|
+
* • interface configuration;
|
|
110
|
+
* • administration of IP firewall, masquerading, and accounting;
|
|
111
|
+
* • modify routing tables;
|
|
112
|
+
* • bind to any address for transparent proxying;
|
|
113
|
+
* • set type-of-service (TOS);
|
|
114
|
+
* • clear driver statistics;
|
|
115
|
+
* • set promiscuous mode;
|
|
116
|
+
* • enabling multicasting;
|
|
117
|
+
* • use setsockopt(2) to set the following socket options: SO_DEBUG, SO_MARK, SO_PRIORITY (for a priority outside the range 0 to 6), SO_RCVBUFFORCE, and SO_SNDBUFFORCE.
|
|
118
|
+
*/
|
|
119
|
+
NET_ADMIN = "NET_ADMIN",
|
|
120
|
+
/**
|
|
121
|
+
* Bind a socket to Internet domain privileged ports (port numbers less than 1024).
|
|
122
|
+
*/
|
|
123
|
+
NET_BIND_SERVICE = "NET_BIND_SERVICE",
|
|
124
|
+
/**
|
|
125
|
+
* (Unused) Make socket broadcasts, and listen to multicasts.
|
|
126
|
+
*/
|
|
127
|
+
NET_BROADCAST = "NET_BROADCAST",
|
|
128
|
+
/**
|
|
129
|
+
* • Use RAW and PACKET sockets;
|
|
130
|
+
* • bind to any address for transparent proxying.
|
|
131
|
+
*/
|
|
132
|
+
NET_RAW = "NET_RAW",
|
|
133
|
+
/**
|
|
134
|
+
* Employ various performance-monitoring mechanisms, including:
|
|
135
|
+
* • call perf_event_open(2);
|
|
136
|
+
* • employ various BPF operations that have performance implications.
|
|
137
|
+
* This capability was added in Linux 5.8 to separate out performance monitoring functionality from the overloaded CAP_SYS_ADMIN capability. See also the kernel source file Documentation/admin-guide/perf-security.rst.
|
|
138
|
+
* (since Linux 5.8)
|
|
139
|
+
*/
|
|
140
|
+
PERFMON = "PERFMON",
|
|
141
|
+
/**
|
|
142
|
+
* • Make arbitrary manipulations of process GIDs and supplementary GID list;
|
|
143
|
+
* • forge GID when passing socket credentials via UNIX domain sockets;
|
|
144
|
+
* • write a group ID mapping in a user namespace (see user_namespaces(7)).
|
|
145
|
+
*/
|
|
146
|
+
SETGID = "SETGID",
|
|
147
|
+
/**
|
|
148
|
+
* Set arbitrary capabilities on a file.
|
|
149
|
+
* Since Linux 5.12, this capability is also needed to map user ID 0 in a new user namespace; see user_namespaces(7) for details.
|
|
150
|
+
* (since Linux 2.6.24)
|
|
151
|
+
*/
|
|
152
|
+
SETFCAP = "SETFCAP",
|
|
153
|
+
/**
|
|
154
|
+
* If file capabilities are supported (i.e., since Linux 2.6.24): add any capability from the calling thread's bounding set to its inheritable set; drop capabilities from the bounding set (via prctl(2) PR_CAPBSET_DROP); make changes to the securebits flags.
|
|
155
|
+
* If file capabilities are not supported (i.e., before Linux 2.6.24): grant or remove any capability in the caller's permitted capability set to or from any other process. (This property of CAP_SETPCAP is not available when the kernel is configured to support file capabilities, since CAP_SETPCAP has entirely different semantics for such kernels.)
|
|
156
|
+
*/
|
|
157
|
+
SETPCAP = "SETPCAP",
|
|
158
|
+
/**
|
|
159
|
+
* • Make arbitrary manipulations of process UIDs (setuid(2), setreuid(2), setresuid(2), setfsuid(2));
|
|
160
|
+
* • forge UID when passing socket credentials via UNIX domain sockets;
|
|
161
|
+
* • write a user ID mapping in a user namespace (see user_namespaces(7)).
|
|
162
|
+
*/
|
|
163
|
+
SETUID = "SETUID",
|
|
164
|
+
/**
|
|
165
|
+
* Note: this capability is overloaded; see Notes to kernel developers below.
|
|
166
|
+
* • Perform a range of system administration operations including: quotactl(2), mount(2), umount(2), pivot_root(2), swapon(2), swapoff(2), sethostname(2), and setdomainname(2);
|
|
167
|
+
* • perform privileged syslog(2) operations (since Linux 2.6.37, CAP_SYSLOG should be used to permit such operations);
|
|
168
|
+
* • perform VM86_REQUEST_IRQ vm86(2) command;
|
|
169
|
+
* • access the same checkpoint/restore functionality that is governed by CAP_CHECKPOINT_RESTORE (but the latter, weaker capability is preferred for accessing that functionality).
|
|
170
|
+
* • perform the same BPF operations as are governed by CAP_BPF (but the latter, weaker capability is preferred for accessing that functionality).
|
|
171
|
+
* • employ the same performance monitoring mechanisms as are governed by CAP_PERFMON (but the latter, weaker capability is preferred for accessing that functionality).
|
|
172
|
+
* • perform IPC_SET and IPC_RMID operations on arbitrary System V IPC objects;
|
|
173
|
+
* • override RLIMIT_NPROC resource limit;
|
|
174
|
+
* • perform operations on trusted and security extended attributes (see xattr(7));
|
|
175
|
+
* • use lookup_dcookie(2);
|
|
176
|
+
* • use ioprio_set(2) to assign IOPRIO_CLASS_RT and (before Linux 2.6.25) IOPRIO_CLASS_IDLE I/O scheduling classes;
|
|
177
|
+
* • forge PID when passing socket credentials via UNIX domain sockets;
|
|
178
|
+
* • exceed /proc/sys/fs/file-max, the system-wide limit on the number of open files, in system calls that open files (e.g., accept(2), execve(2), open(2), pipe(2));
|
|
179
|
+
* • employ CLONE_* flags that create new namespaces with clone(2) and unshare(2) (but, since Linux 3.8, creating user namespaces does not require any capability);
|
|
180
|
+
* • access privileged perf event information;
|
|
181
|
+
* • call setns(2) (requires CAP_SYS_ADMIN in the target namespace);
|
|
182
|
+
* • call fanotify_init(2);
|
|
183
|
+
* • perform privileged KEYCTL_CHOWN and KEYCTL_SETPERM keyctl(2) operations;
|
|
184
|
+
* • perform madvise(2) MADV_HWPOISON operation;
|
|
185
|
+
* • employ the TIOCSTI ioctl(2) to insert characters into the input queue of a terminal other than the caller's controlling terminal;
|
|
186
|
+
* • employ the obsolete nfsservctl(2) system call;
|
|
187
|
+
* • employ the obsolete bdflush(2) system call;
|
|
188
|
+
* • perform various privileged block-device ioctl(2) operations;
|
|
189
|
+
* • perform various privileged filesystem ioctl(2) operations;
|
|
190
|
+
* • perform privileged ioctl(2) operations on the /dev/random device (see random(4));
|
|
191
|
+
* • install a seccomp(2) filter without first having to set the no_new_privs thread attribute;
|
|
192
|
+
* • modify allow/deny rules for device control groups;
|
|
193
|
+
* • employ the ptrace(2) PTRACE_SECCOMP_GET_FILTER operation to dump tracee's seccomp filters;
|
|
194
|
+
* • employ the ptrace(2) PTRACE_SETOPTIONS operation to suspend the tracee's seccomp protections (i.e., the PTRACE_O_SUSPEND_SECCOMP flag);
|
|
195
|
+
* • perform administrative operations on many device drivers;
|
|
196
|
+
* • modify autogroup nice values by writing to /proc/pid/autogroup (see sched(7)).
|
|
197
|
+
*/
|
|
198
|
+
SYS_ADMIN = "SYS_ADMIN",
|
|
199
|
+
/**
|
|
200
|
+
* Use reboot(2) and kexec_load(2).
|
|
201
|
+
*/
|
|
202
|
+
SYS_BOOT = "SYS_BOOT",
|
|
203
|
+
/**
|
|
204
|
+
* • Use chroot(2);
|
|
205
|
+
* • change mount namespaces using setns(2).
|
|
206
|
+
*/
|
|
207
|
+
SYS_CHROOT = "SYS_CHROOT",
|
|
208
|
+
/**
|
|
209
|
+
* • Load and unload kernel modules (see init_module(2) and delete_module(2));
|
|
210
|
+
* • before Linux 2.6.25: drop capabilities from the system-wide capability bounding set.
|
|
211
|
+
*/
|
|
212
|
+
SYS_MODULE = "SYS_MODULE",
|
|
213
|
+
/**
|
|
214
|
+
* • Lower the process nice value (nice(2), setpriority(2)) and change the nice value for arbitrary processes;
|
|
215
|
+
* • set real-time scheduling policies for calling process, and set scheduling policies and priorities for arbitrary processes (sched_setscheduler(2), sched_setparam(2), sched_setattr(2));
|
|
216
|
+
* • set CPU affinity for arbitrary processes (sched_setaffinity(2));
|
|
217
|
+
* • set I/O scheduling class and priority for arbitrary processes (ioprio_set(2));
|
|
218
|
+
* • apply migrate_pages(2) to arbitrary processes and allow processes to be migrated to arbitrary nodes;
|
|
219
|
+
* • apply move_pages(2) to arbitrary processes;
|
|
220
|
+
* • use the MPOL_MF_MOVE_ALL flag with mbind(2) and move_pages(2).
|
|
221
|
+
*/
|
|
222
|
+
SYS_NICE = "SYS_NICE",
|
|
223
|
+
/**
|
|
224
|
+
* Use acct(2).
|
|
225
|
+
*/
|
|
226
|
+
SYS_PACCT = "SYS_PACCT",
|
|
227
|
+
/**
|
|
228
|
+
* • Trace arbitrary processes using ptrace(2);
|
|
229
|
+
* • apply get_robust_list(2) to arbitrary processes;
|
|
230
|
+
* • transfer data to or from the memory of arbitrary processes using process_vm_readv(2) and process_vm_writev(2);
|
|
231
|
+
* • inspect processes using kcmp(2).
|
|
232
|
+
*/
|
|
233
|
+
SYS_PTRACE = "SYS_PTRACE",
|
|
234
|
+
/**
|
|
235
|
+
* • Perform I/O port operations (iopl(2) and ioperm(2));
|
|
236
|
+
* • access /proc/kcore;
|
|
237
|
+
* • employ the FIBMAP ioctl(2) operation;
|
|
238
|
+
* • open devices for accessing x86 model-specific registers (MSRs, see msr(4));
|
|
239
|
+
* • update /proc/sys/vm/mmap_min_addr;
|
|
240
|
+
* • create memory mappings at addresses below the value specified by /proc/sys/vm/mmap_min_addr;
|
|
241
|
+
* • map files in /proc/bus/pci;
|
|
242
|
+
* • open /dev/mem and /dev/kmem;
|
|
243
|
+
* • perform various SCSI device commands;
|
|
244
|
+
* • perform certain operations on hpsa(4) and cciss(4) devices;
|
|
245
|
+
* • perform a range of device-specific operations on other devices.
|
|
246
|
+
*/
|
|
247
|
+
SYS_RAWIO = "SYS_RAWIO",
|
|
248
|
+
/**
|
|
249
|
+
* • Use reserved space on ext2 filesystems;
|
|
250
|
+
* • make ioctl(2) calls controlling ext3 journaling;
|
|
251
|
+
* • override disk quota limits;
|
|
252
|
+
* • increase resource limits (see setrlimit(2));
|
|
253
|
+
* • override RLIMIT_NPROC resource limit;
|
|
254
|
+
* • override maximum number of consoles on console allocation;
|
|
255
|
+
* • override maximum number of keymaps;
|
|
256
|
+
* • allow more than 64hz interrupts from the real-time clock;
|
|
257
|
+
* • raise msg_qbytes limit for a System V message queue above the limit in /proc/sys/kernel/msgmnb (see msgop(2) and msgctl(2));
|
|
258
|
+
* • allow the RLIMIT_NOFILE resource limit on the number of "in-flight" file descriptors to be bypassed when passing file descriptors to another process via a UNIX domain socket (see unix(7));
|
|
259
|
+
* • override the /proc/sys/fs/pipe-size-max limit when setting the capacity of a pipe using the F_SETPIPE_SZ fcntl(2) command;
|
|
260
|
+
* • use F_SETPIPE_SZ to increase the capacity of a pipe above the limit specified by /proc/sys/fs/pipe-max-size;
|
|
261
|
+
* • override /proc/sys/fs/mqueue/queues_max, /proc/sys/fs/mqueue/msg_max, and /proc/sys/fs/mqueue/msgsize_max limits when creating POSIX message queues (see mq_overview(7));
|
|
262
|
+
* • employ the prctl(2) PR_SET_MM operation;
|
|
263
|
+
* • set /proc/pid/oom_score_adj to a value lower than the value last set by a process with CAP_SYS_RESOURCE.
|
|
264
|
+
*/
|
|
265
|
+
SYS_RESOURCE = "SYS_RESOURCE",
|
|
266
|
+
/**
|
|
267
|
+
* Set system clock (settimeofday(2), stime(2), adjtimex(2));
|
|
268
|
+
* set real-time (hardware) clock.
|
|
269
|
+
*/
|
|
270
|
+
SYS_TIME = "SYS_TIME",
|
|
271
|
+
/**
|
|
272
|
+
* Use vhangup(2); employ various privileged ioctl(2) operations on virtual terminals.
|
|
273
|
+
*/
|
|
274
|
+
SYS_TTY_CONFIG = "SYS_TTY_CONFIG",
|
|
275
|
+
/**
|
|
276
|
+
* • Perform privileged syslog(2) operations. See syslog(2) for information on which operations require privilege.
|
|
277
|
+
* • View kernel addresses exposed via /proc and other interfaces when /proc/sys/kernel/kptr_restrict has the value 1. (See the discussion of the kptr_restrict in proc(5).)
|
|
278
|
+
* (since Linux 2.6.37)
|
|
279
|
+
*/
|
|
280
|
+
SYSLOG = "SYSLOG",
|
|
281
|
+
/**
|
|
282
|
+
* Trigger something that will wake up the system (set CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM timers).
|
|
283
|
+
* (since Linux 3.0)
|
|
284
|
+
*/
|
|
285
|
+
WAKE_ALARM = "WAKE_ALARM"
|
|
286
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A container's resource settings, in the Docker Engine's terms. No method of the component returns or accepts it:
|
|
3
|
+
* {@link DockerContainer} exposes these settings as its own properties (`memoryLimit`, `cpuSet`, `devices`,
|
|
4
|
+
* `OOMKillDisable`, `restartPolicy`), and {@link ContainerSettingOptions} sets them.
|
|
5
|
+
*/
|
|
6
|
+
export type ContainerConfig = {
|
|
7
|
+
/**
|
|
8
|
+
* The memory limit, in bytes; `0` for no limit.
|
|
9
|
+
*/
|
|
10
|
+
memory: number;
|
|
11
|
+
/**
|
|
12
|
+
* The indexes of the host CPUs the container may run on (`[0, 1]`).
|
|
13
|
+
*/
|
|
14
|
+
cpus: number[];
|
|
15
|
+
/**
|
|
16
|
+
* The host devices made available in the container.
|
|
17
|
+
*/
|
|
18
|
+
devices: {
|
|
19
|
+
/**
|
|
20
|
+
* The path of the device on the host (`/dev/ttyUSB0`).
|
|
21
|
+
*/
|
|
22
|
+
hostPath: string;
|
|
23
|
+
/**
|
|
24
|
+
* The path of the device in the container.
|
|
25
|
+
*/
|
|
26
|
+
containerPath: string;
|
|
27
|
+
/**
|
|
28
|
+
* What the container's cgroup allows on the device: a combination of `r`, `w` and `m` (`"rwm"`).
|
|
29
|
+
*/
|
|
30
|
+
cgroupPermissions: string;
|
|
31
|
+
}[];
|
|
32
|
+
/**
|
|
33
|
+
* `true` when the kernel's OOM killer does not kill the container's processes when it runs out of memory.
|
|
34
|
+
*/
|
|
35
|
+
OOMKillDisable: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The resource limits (ulimits) of the container's processes.
|
|
38
|
+
*/
|
|
39
|
+
ulimits: {
|
|
40
|
+
/**
|
|
41
|
+
* The limit name (`nofile`, `nproc`).
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The soft limit, which a process can raise up to the hard limit.
|
|
46
|
+
*/
|
|
47
|
+
soft: number;
|
|
48
|
+
/**
|
|
49
|
+
* The hard limit.
|
|
50
|
+
*/
|
|
51
|
+
hard: number;
|
|
52
|
+
}[];
|
|
53
|
+
/**
|
|
54
|
+
* When Docker restarts the container after it exits.
|
|
55
|
+
*/
|
|
56
|
+
restartPolicy: {
|
|
57
|
+
/**
|
|
58
|
+
* The policy: `''` or `'no'`, never; `'always'`, always; `'unless-stopped'`, always except after the container
|
|
59
|
+
* was stopped by hand; `'on-failure'`, only when it exits with a non-zero code.
|
|
60
|
+
*/
|
|
61
|
+
name: '' | 'no' | 'always' | 'unless-stopped' | 'on-failure';
|
|
62
|
+
/**
|
|
63
|
+
* With `'on-failure'`, the number of restarts before Docker gives up; `0` for no limit.
|
|
64
|
+
*/
|
|
65
|
+
maximumRetryCount: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A host device made available in a container (`docker run --device`). Read from the container's settings
|
|
3
|
+
* (`DockerContainer.devices`) and given to {@link ContainerSettingOptions.devices}.
|
|
4
|
+
*/
|
|
5
|
+
export type ContainerDevice = {
|
|
6
|
+
/**
|
|
7
|
+
* The path of the device on the host (`/dev/ttyUSB0`).
|
|
8
|
+
*/
|
|
9
|
+
hostPath: string;
|
|
10
|
+
/**
|
|
11
|
+
* The path of the device in the container (`/dev/ttyUSB0`).
|
|
12
|
+
*/
|
|
13
|
+
containerPath: string;
|
|
14
|
+
/**
|
|
15
|
+
* What the container's cgroup allows on the device: a combination of `r` (read), `w` (write) and `m` (create
|
|
16
|
+
* device nodes with mknod), `"rwm"` for all of them.
|
|
17
|
+
*/
|
|
18
|
+
cgroupPermissions: string;
|
|
19
|
+
};
|