@ac-kit/cmd-docker 0.1.0 → 0.2.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/CHANGELOG.md +31 -52
- package/dist/_docker-command.d.ts +14 -0
- package/dist/_docker-command.d.ts.map +1 -0
- package/dist/_docker-command.js +23 -0
- package/dist/_docker-command.js.map +1 -0
- package/dist/buildx/buildx-build.d.ts +2 -1
- package/dist/buildx/buildx-build.d.ts.map +1 -1
- package/dist/buildx/buildx-build.js +4 -4
- package/dist/buildx/buildx-build.js.map +1 -1
- package/dist/container/container-exec.d.ts +6 -4
- package/dist/container/container-exec.d.ts.map +1 -1
- package/dist/container/container-exec.js +12 -13
- package/dist/container/container-exec.js.map +1 -1
- package/dist/container/container-rm.d.ts +2 -2
- package/dist/container/container-rm.d.ts.map +1 -1
- package/dist/container/container-rm.js +3 -3
- package/dist/container/container-rm.js.map +1 -1
- package/dist/container/container-run.d.ts +7 -4
- package/dist/container/container-run.d.ts.map +1 -1
- package/dist/container/container-run.js +19 -19
- package/dist/container/container-run.js.map +1 -1
- package/dist/container/container-stop.d.ts +2 -2
- package/dist/container/container-stop.d.ts.map +1 -1
- package/dist/container/container-stop.js +3 -3
- package/dist/container/container-stop.js.map +1 -1
- package/dist/context/context-show.d.ts +3 -1
- package/dist/context/context-show.d.ts.map +1 -1
- package/dist/context/context-show.js +4 -6
- package/dist/context/context-show.js.map +1 -1
- package/dist/context/context-use.js +2 -2
- package/dist/context/context-use.js.map +1 -1
- package/dist/image/image-rm.d.ts +2 -3
- package/dist/image/image-rm.d.ts.map +1 -1
- package/dist/image/image-rm.js +3 -3
- package/dist/image/image-rm.js.map +1 -1
- package/dist/network/network-create.d.ts +2 -1
- package/dist/network/network-create.d.ts.map +1 -1
- package/dist/network/network-create.js +4 -4
- package/dist/network/network-create.js.map +1 -1
- package/dist/network/network-rm.d.ts +3 -1
- package/dist/network/network-rm.d.ts.map +1 -1
- package/dist/network/network-rm.js +3 -4
- package/dist/network/network-rm.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,57 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- `
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Changed
|
|
34
|
-
|
|
35
|
-
- Upgrade `@ac-essentials/util` dependency to `^0.6.0`.
|
|
36
|
-
|
|
37
|
-
## [0.1.3] - 2025-09-20
|
|
38
|
-
|
|
39
|
-
### Fixed
|
|
40
|
-
|
|
41
|
-
- Fix unchecked indexed access.
|
|
42
|
-
|
|
43
|
-
### Changed
|
|
44
|
-
|
|
45
|
-
- Bump `type-fest` dependency to `^5.0.1`.
|
|
46
|
-
|
|
47
|
-
## [0.1.2] - 2025-09-20
|
|
48
|
-
|
|
49
|
-
### Fixed
|
|
50
|
-
|
|
51
|
-
- Fixed dependencies binding in `package.json`.
|
|
52
|
-
|
|
53
|
-
## [0.1.1] - 2025-09-13
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a493b4a: Every command accepts a `context`, and the invocation is assembled in one place.
|
|
8
|
+
|
|
9
|
+
- `DockerCommonOptions` adds `context` to all ten commands, emitted as
|
|
10
|
+
`docker --context <name> <subcommand>`. Naming the context per command leaves
|
|
11
|
+
the daemon the rest of the machine talks to alone, which `dockerContextUse`
|
|
12
|
+
does not. `dockerNetworkRm` and `dockerContextShow` gain an options parameter
|
|
13
|
+
to carry it.
|
|
14
|
+
- The new internal `execDocker` owns where the CLI's global flags go — before
|
|
15
|
+
the subcommand, which is the only position docker accepts them in — so no
|
|
16
|
+
command interpolates its own string any more. Every command now asks
|
|
17
|
+
`execAsync` for `utf8`; `dockerContainerRun` and the others that did not used
|
|
18
|
+
to would have returned a `Buffer` had they read their output.
|
|
19
|
+
- `DockerImageId` is exported, alongside `DockerContainerId` and
|
|
20
|
+
`DockerContainerName`.
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 732a70b: Fix dockerContextShow() function
|
|
25
|
+
- Updated dependencies [a493b4a]
|
|
26
|
+
- Updated dependencies [a493b4a]
|
|
27
|
+
- Updated dependencies [a493b4a]
|
|
28
|
+
- Updated dependencies [70c1269]
|
|
29
|
+
- @ac-kit/node@0.2.0
|
|
30
|
+
- @ac-kit/format-shell@0.2.0
|
|
31
|
+
|
|
32
|
+
## [0.1.0] - 2026-09-01
|
|
54
33
|
|
|
55
34
|
### Added
|
|
56
35
|
|
|
57
|
-
-
|
|
36
|
+
- Initial release.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DockerCommonOptions } from "./types.js";
|
|
2
|
+
/** Quote one value for the shell `execDocker` hands the command line to. */
|
|
3
|
+
export declare function dockerArg(value: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Run a docker subcommand.
|
|
6
|
+
*
|
|
7
|
+
* The CLI only accepts its global flags before the subcommand, so this is the
|
|
8
|
+
* one place that knows where they go.
|
|
9
|
+
*/
|
|
10
|
+
export declare function execDocker(subcommand: string, args: readonly string[], options?: DockerCommonOptions): Promise<{
|
|
11
|
+
stdout: string;
|
|
12
|
+
stderr: string;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=_docker-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_docker-command.d.ts","sourceRoot":"","sources":["../src/_docker-command.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAItD,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC/B,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAU7C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { platform } from "node:process";
|
|
2
|
+
import { escapeCommandArg, shellDialectForPlatform, } from "@ac-kit/format-shell";
|
|
3
|
+
import { execAsync } from "@ac-kit/node";
|
|
4
|
+
const SHELL_DIALECT_ = shellDialectForPlatform(platform);
|
|
5
|
+
/** Quote one value for the shell `execDocker` hands the command line to. */
|
|
6
|
+
export function dockerArg(value) {
|
|
7
|
+
return escapeCommandArg(value, SHELL_DIALECT_);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Run a docker subcommand.
|
|
11
|
+
*
|
|
12
|
+
* The CLI only accepts its global flags before the subcommand, so this is the
|
|
13
|
+
* one place that knows where they go.
|
|
14
|
+
*/
|
|
15
|
+
export async function execDocker(subcommand, args, options) {
|
|
16
|
+
const words = ["docker"];
|
|
17
|
+
if (options?.context !== undefined && options.context.length > 0) {
|
|
18
|
+
words.push("--context", dockerArg(options.context));
|
|
19
|
+
}
|
|
20
|
+
words.push(subcommand, ...args);
|
|
21
|
+
return execAsync(words.join(" "), { encoding: "utf8" });
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=_docker-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_docker-command.js","sourceRoot":"","sources":["../src/_docker-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EACN,gBAAgB,EAChB,uBAAuB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,cAAc,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;AAEzD,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,KAAa;IACtC,OAAO,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC/B,UAAkB,EAClB,IAAuB,EACvB,OAA6B;IAE7B,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC;IAEzB,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,CAAC;IAEhC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Url } from "node:url";
|
|
2
|
-
|
|
2
|
+
import type { DockerCommonOptions } from "../types.js";
|
|
3
|
+
export type DockerBuildxBuildOptions = DockerCommonOptions & {
|
|
3
4
|
tags?: string[];
|
|
4
5
|
};
|
|
5
6
|
export declare function dockerBuildxBuild(pathOrUrl: string | Url, options?: DockerBuildxBuildOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildx-build.d.ts","sourceRoot":"","sources":["../../src/buildx/buildx-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"buildx-build.d.ts","sourceRoot":"","sources":["../../src/buildx/buildx-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAGpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IAC5D,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC;AAEF,wBAAsB,iBAAiB,CACtC,SAAS,EAAE,MAAM,GAAG,GAAG,EACvB,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAWf"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerBuildxBuild(pathOrUrl, options) {
|
|
3
3
|
const execArgs = [];
|
|
4
4
|
for (const tag of options?.tags ?? []) {
|
|
5
|
-
execArgs.push(`--tag ${
|
|
5
|
+
execArgs.push(`--tag ${dockerArg(tag)}`);
|
|
6
6
|
}
|
|
7
7
|
// oxlint-disable-next-line typescript/no-base-to-string
|
|
8
|
-
execArgs.push(
|
|
9
|
-
await
|
|
8
|
+
execArgs.push(dockerArg(pathOrUrl.toString()));
|
|
9
|
+
await execDocker("buildx build", execArgs, options);
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=buildx-build.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildx-build.js","sourceRoot":"","sources":["../../src/buildx/buildx-build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"buildx-build.js","sourceRoot":"","sources":["../../src/buildx/buildx-build.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAO9D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,SAAuB,EACvB,OAAkC;IAElC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;QACvC,QAAQ,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAE/C,MAAM,UAAU,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { EnvVariables } from "@ac-kit/format-shell";
|
|
2
|
+
import type { DockerCommonOptions, DockerContainerId, DockerContainerName } from "../types.js";
|
|
3
|
+
export type DockerContainerExecOptions = DockerCommonOptions & {
|
|
4
|
+
commandArgs?: string[];
|
|
5
|
+
env?: EnvVariables;
|
|
4
6
|
user?: string;
|
|
5
7
|
workdir?: string;
|
|
6
8
|
};
|
|
7
|
-
export declare function dockerContainerExec(container: DockerContainerId | DockerContainerName, command: string,
|
|
9
|
+
export declare function dockerContainerExec(container: DockerContainerId | DockerContainerName, command: string, options?: DockerContainerExecOptions): Promise<{
|
|
8
10
|
stdout: string;
|
|
9
11
|
stderr: string;
|
|
10
12
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-exec.d.ts","sourceRoot":"","sources":["../../src/container/container-exec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-exec.d.ts","sourceRoot":"","sources":["../../src/container/container-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AAGxE,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC9D,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,mBAAmB,CACxC,SAAS,EAAE,iBAAiB,GAAG,mBAAmB,EAClD,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB7C"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export async function dockerContainerExec(container, command,
|
|
1
|
+
import { printEnvAssignment } from "@ac-kit/format-shell";
|
|
2
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
3
|
+
export async function dockerContainerExec(container, command, options) {
|
|
4
4
|
const execArgs = [];
|
|
5
|
-
for (const [
|
|
6
|
-
execArgs.push(`--env ${
|
|
5
|
+
for (const [name, value] of Object.entries(options?.env ?? {})) {
|
|
6
|
+
execArgs.push(`--env ${dockerArg(printEnvAssignment(name, value))}`);
|
|
7
7
|
}
|
|
8
8
|
if (options?.user && options.user.length > 0) {
|
|
9
|
-
execArgs.push(`--user ${
|
|
9
|
+
execArgs.push(`--user ${dockerArg(options.user)}`);
|
|
10
10
|
}
|
|
11
11
|
if (options?.workdir && options.workdir.length > 0) {
|
|
12
|
-
execArgs.push(`--workdir ${
|
|
12
|
+
execArgs.push(`--workdir ${dockerArg(options.workdir)}`);
|
|
13
13
|
}
|
|
14
|
-
execArgs.push(
|
|
15
|
-
execArgs.push(
|
|
16
|
-
for (const commandArg of commandArgs ?? []) {
|
|
17
|
-
execArgs.push(
|
|
14
|
+
execArgs.push(dockerArg(container));
|
|
15
|
+
execArgs.push(dockerArg(command));
|
|
16
|
+
for (const commandArg of options?.commandArgs ?? []) {
|
|
17
|
+
execArgs.push(dockerArg(commandArg));
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
return { stdout, stderr };
|
|
19
|
+
return execDocker("container exec", execArgs, options);
|
|
21
20
|
}
|
|
22
21
|
//# sourceMappingURL=container-exec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-exec.js","sourceRoot":"","sources":["../../src/container/container-exec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"container-exec.js","sourceRoot":"","sources":["../../src/container/container-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAc9D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,SAAkD,EAClD,OAAe,EACf,OAAoC;IAEpC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,QAAQ,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,UAAU,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,QAAQ,CAAC,IAAI,CAAC,aAAa,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAElC,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DockerContainerId, DockerContainerName } from "../types.js";
|
|
2
|
-
export type DockerContainerRmOptions = {
|
|
1
|
+
import type { DockerCommonOptions, DockerContainerId, DockerContainerName } from "../types.js";
|
|
2
|
+
export type DockerContainerRmOptions = DockerCommonOptions & {
|
|
3
3
|
force?: boolean;
|
|
4
4
|
link?: boolean;
|
|
5
5
|
volumes?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-rm.d.ts","sourceRoot":"","sources":["../../src/container/container-rm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-rm.d.ts","sourceRoot":"","sources":["../../src/container/container-rm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,iBAAiB,CACtC,UAAU,EAAE,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,EAAE,EACvD,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerContainerRm(containers, options) {
|
|
3
3
|
const execArgs = [];
|
|
4
4
|
if (options?.force) {
|
|
@@ -11,8 +11,8 @@ export async function dockerContainerRm(containers, options) {
|
|
|
11
11
|
execArgs.push("--volumes");
|
|
12
12
|
}
|
|
13
13
|
for (const container of containers) {
|
|
14
|
-
execArgs.push(
|
|
14
|
+
execArgs.push(dockerArg(container));
|
|
15
15
|
}
|
|
16
|
-
await
|
|
16
|
+
await execDocker("container rm", execArgs, options);
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=container-rm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-rm.js","sourceRoot":"","sources":["../../src/container/container-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"container-rm.js","sourceRoot":"","sources":["../../src/container/container-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAa9D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,UAAuD,EACvD,OAAkC;IAElC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,EAAE,IAAI,EAAE,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,UAAU,CAAC,cAAc,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { EnvVariables } from "@ac-kit/format-shell";
|
|
2
|
+
import type { DockerCommonOptions, DockerContainerName } from "../types.js";
|
|
3
|
+
export type DockerContainerRunOptions = DockerCommonOptions & {
|
|
4
|
+
command?: string;
|
|
5
|
+
commandArgs?: string[];
|
|
3
6
|
rm?: boolean;
|
|
4
7
|
detach?: boolean;
|
|
5
8
|
name?: DockerContainerName;
|
|
6
9
|
network?: string;
|
|
7
10
|
addHost?: string[];
|
|
8
|
-
env?:
|
|
11
|
+
env?: EnvVariables;
|
|
9
12
|
publish?: string[];
|
|
10
13
|
volume?: string[];
|
|
11
14
|
};
|
|
12
|
-
export declare function dockerContainerRun(image: string,
|
|
15
|
+
export declare function dockerContainerRun(image: string, options?: DockerContainerRunOptions): Promise<void>;
|
|
13
16
|
//# sourceMappingURL=container-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-run.d.ts","sourceRoot":"","sources":["../../src/container/container-run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-run.d.ts","sourceRoot":"","sources":["../../src/container/container-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AAGxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,GAAG;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,yBAAyB,GACjC,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export async function dockerContainerRun(image,
|
|
1
|
+
import { printEnvAssignment } from "@ac-kit/format-shell";
|
|
2
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
3
|
+
export async function dockerContainerRun(image, options) {
|
|
4
4
|
const execArgs = [];
|
|
5
5
|
if (options?.rm) {
|
|
6
6
|
execArgs.push("--rm");
|
|
@@ -9,30 +9,30 @@ export async function dockerContainerRun(image, command, commandArgs, options) {
|
|
|
9
9
|
execArgs.push("--detach");
|
|
10
10
|
}
|
|
11
11
|
if (options?.name && options.name.length > 0) {
|
|
12
|
-
execArgs.push(`--name ${
|
|
12
|
+
execArgs.push(`--name ${dockerArg(options.name)}`);
|
|
13
13
|
}
|
|
14
14
|
if (options?.network && options.network.length > 0) {
|
|
15
|
-
execArgs.push(`--network ${
|
|
15
|
+
execArgs.push(`--network ${dockerArg(options.network)}`);
|
|
16
16
|
}
|
|
17
|
-
for (const
|
|
18
|
-
execArgs.push(`--add-host ${
|
|
17
|
+
for (const addHost of options?.addHost ?? []) {
|
|
18
|
+
execArgs.push(`--add-host ${dockerArg(addHost)}`);
|
|
19
19
|
}
|
|
20
|
-
for (const [
|
|
21
|
-
execArgs.push(`--env ${
|
|
20
|
+
for (const [name, value] of Object.entries(options?.env ?? {})) {
|
|
21
|
+
execArgs.push(`--env ${dockerArg(printEnvAssignment(name, value))}`);
|
|
22
22
|
}
|
|
23
|
-
for (const
|
|
24
|
-
execArgs.push(`--publish ${
|
|
23
|
+
for (const publish of options?.publish ?? []) {
|
|
24
|
+
execArgs.push(`--publish ${dockerArg(publish)}`);
|
|
25
25
|
}
|
|
26
|
-
for (const
|
|
27
|
-
execArgs.push(`--volume ${
|
|
26
|
+
for (const volume of options?.volume ?? []) {
|
|
27
|
+
execArgs.push(`--volume ${dockerArg(volume)}`);
|
|
28
28
|
}
|
|
29
|
-
execArgs.push(
|
|
30
|
-
if (command) {
|
|
31
|
-
execArgs.push(
|
|
32
|
-
for (const commandArg of commandArgs ?? []) {
|
|
33
|
-
execArgs.push(
|
|
29
|
+
execArgs.push(dockerArg(image));
|
|
30
|
+
if (options?.command) {
|
|
31
|
+
execArgs.push(dockerArg(options.command));
|
|
32
|
+
for (const commandArg of options?.commandArgs ?? []) {
|
|
33
|
+
execArgs.push(dockerArg(commandArg));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
await
|
|
36
|
+
await execDocker("container run", execArgs, options);
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=container-run.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-run.js","sourceRoot":"","sources":["../../src/container/container-run.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"container-run.js","sourceRoot":"","sources":["../../src/container/container-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgB9D,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,KAAa,EACb,OAAmC;IAEnC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACrB,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,OAAO,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,UAAU,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,QAAQ,CAAC,IAAI,CAAC,aAAa,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,cAAc,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,QAAQ,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,CAAC;QAC9C,QAAQ,CAAC,IAAI,CAAC,aAAa,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;QAC5C,QAAQ,CAAC,IAAI,CAAC,YAAY,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAEhC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QAE1C,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC;YACrD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QACtC,CAAC;IACF,CAAC;IAED,MAAM,UAAU,CAAC,eAAe,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DockerContainerId, DockerContainerName } from "../types.js";
|
|
2
|
-
export type DockerContainerStopOptions = {
|
|
1
|
+
import type { DockerCommonOptions, DockerContainerId, DockerContainerName } from "../types.js";
|
|
2
|
+
export type DockerContainerStopOptions = DockerCommonOptions & {
|
|
3
3
|
/** Seconds to wait before killing the container. */
|
|
4
4
|
time?: number;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-stop.d.ts","sourceRoot":"","sources":["../../src/container/container-stop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container-stop.d.ts","sourceRoot":"","sources":["../../src/container/container-stop.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC9D,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,mBAAmB,CACxC,UAAU,EAAE,CAAC,iBAAiB,GAAG,mBAAmB,CAAC,EAAE,EACvD,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerContainerStop(containers, options) {
|
|
3
3
|
const execArgs = [];
|
|
4
4
|
if (options?.time !== undefined) {
|
|
5
5
|
execArgs.push(`--time ${options.time}`);
|
|
6
6
|
}
|
|
7
7
|
for (const container of containers) {
|
|
8
|
-
execArgs.push(
|
|
8
|
+
execArgs.push(dockerArg(container));
|
|
9
9
|
}
|
|
10
|
-
await
|
|
10
|
+
await execDocker("container stop", execArgs, options);
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=container-stop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-stop.js","sourceRoot":"","sources":["../../src/container/container-stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"container-stop.js","sourceRoot":"","sources":["../../src/container/container-stop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAY9D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,UAAuD,EACvD,OAAoC;IAEpC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;QACjC,QAAQ,CAAC,IAAI,CAAC,UAAU,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,UAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DockerCommonOptions } from "../types.js";
|
|
2
|
+
export type DockerContextShowOptions = DockerCommonOptions;
|
|
3
|
+
export declare function dockerContextShow(options?: DockerContextShowOptions): Promise<string>;
|
|
2
4
|
//# sourceMappingURL=context-show.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-show.d.ts","sourceRoot":"","sources":["../../src/context/context-show.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context-show.d.ts","sourceRoot":"","sources":["../../src/context/context-show.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE3D,wBAAsB,iBAAiB,CACtC,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export async function dockerContextShow() {
|
|
3
|
-
const { stdout } = await
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
return stdout;
|
|
1
|
+
import { execDocker } from "../_docker-command.js";
|
|
2
|
+
export async function dockerContextShow(options) {
|
|
3
|
+
const { stdout } = await execDocker("context show", [], options);
|
|
4
|
+
return stdout.trim();
|
|
7
5
|
}
|
|
8
6
|
//# sourceMappingURL=context-show.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-show.js","sourceRoot":"","sources":["../../src/context/context-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context-show.js","sourceRoot":"","sources":["../../src/context/context-show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKnD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACtC,OAAkC;IAElC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC,cAAc,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAEjE,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerContextUse(context) {
|
|
3
|
-
await
|
|
3
|
+
await execDocker("context use", [dockerArg(context)]);
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=context-use.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-use.js","sourceRoot":"","sources":["../../src/context/context-use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context-use.js","sourceRoot":"","sources":["../../src/context/context-use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAe;IACrD,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/image/image-rm.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
type DockerImageId
|
|
2
|
-
export type DockerImageRmOptions = {
|
|
1
|
+
import type { DockerCommonOptions, DockerImageId } from "../types.js";
|
|
2
|
+
export type DockerImageRmOptions = DockerCommonOptions & {
|
|
3
3
|
force?: boolean;
|
|
4
4
|
noPrune?: boolean;
|
|
5
5
|
};
|
|
6
6
|
export declare function dockerImageRm(images: DockerImageId[], options?: DockerImageRmOptions): Promise<void>;
|
|
7
|
-
export {};
|
|
8
7
|
//# sourceMappingURL=image-rm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-rm.d.ts","sourceRoot":"","sources":["../../src/image/image-rm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-rm.d.ts","sourceRoot":"","sources":["../../src/image/image-rm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IACxD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,wBAAsB,aAAa,CAClC,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,CAAC,EAAE,oBAAoB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAef"}
|
package/dist/image/image-rm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerImageRm(images, options) {
|
|
3
3
|
const execArgs = [];
|
|
4
4
|
if (options?.force) {
|
|
@@ -8,8 +8,8 @@ export async function dockerImageRm(images, options) {
|
|
|
8
8
|
execArgs.push("--no-prune");
|
|
9
9
|
}
|
|
10
10
|
for (const image of images) {
|
|
11
|
-
execArgs.push(
|
|
11
|
+
execArgs.push(dockerArg(image));
|
|
12
12
|
}
|
|
13
|
-
await
|
|
13
|
+
await execDocker("image rm", execArgs, options);
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=image-rm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-rm.js","sourceRoot":"","sources":["../../src/image/image-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"image-rm.js","sourceRoot":"","sources":["../../src/image/image-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAQ9D,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,MAAuB,EACvB,OAA8B;IAE9B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,UAAU,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DockerCommonOptions } from "../types.js";
|
|
2
|
+
export type DockerNetworkCreateOptions = DockerCommonOptions & {
|
|
2
3
|
driver?: string;
|
|
3
4
|
};
|
|
4
5
|
export declare function dockerNetworkCreate(network: string, options?: DockerNetworkCreateOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-create.d.ts","sourceRoot":"","sources":["../../src/network/network-create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"network-create.d.ts","sourceRoot":"","sources":["../../src/network/network-create.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,0BAA0B,GAAG,mBAAmB,GAAG;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
2
|
export async function dockerNetworkCreate(network, options) {
|
|
3
3
|
const execArgs = [];
|
|
4
4
|
if (options?.driver && options.driver.length > 0) {
|
|
5
|
-
execArgs.push(`--driver ${
|
|
5
|
+
execArgs.push(`--driver ${dockerArg(options.driver)}`);
|
|
6
6
|
}
|
|
7
|
-
execArgs.push(
|
|
8
|
-
await
|
|
7
|
+
execArgs.push(dockerArg(network));
|
|
8
|
+
await execDocker("network create", execArgs, options);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=network-create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-create.js","sourceRoot":"","sources":["../../src/network/network-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"network-create.js","sourceRoot":"","sources":["../../src/network/network-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAO9D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAe,EACf,OAAoC;IAEpC,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,OAAO,EAAE,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClD,QAAQ,CAAC,IAAI,CAAC,YAAY,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAElC,MAAM,UAAU,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DockerCommonOptions } from "../types.js";
|
|
2
|
+
export type DockerNetworkRmOptions = DockerCommonOptions;
|
|
3
|
+
export declare function dockerNetworkRm(networks: string[], options?: DockerNetworkRmOptions): Promise<void>;
|
|
2
4
|
//# sourceMappingURL=network-rm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-rm.d.ts","sourceRoot":"","sources":["../../src/network/network-rm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"network-rm.d.ts","sourceRoot":"","sources":["../../src/network/network-rm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAEzD,wBAAsB,eAAe,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,CAAC,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export async function dockerNetworkRm(networks) {
|
|
3
|
-
|
|
4
|
-
await execAsync(`docker network rm ${execArgs.join(" ")}`);
|
|
1
|
+
import { dockerArg, execDocker } from "../_docker-command.js";
|
|
2
|
+
export async function dockerNetworkRm(networks, options) {
|
|
3
|
+
await execDocker("network rm", networks.map(dockerArg), options);
|
|
5
4
|
}
|
|
6
5
|
//# sourceMappingURL=network-rm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-rm.js","sourceRoot":"","sources":["../../src/network/network-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"network-rm.js","sourceRoot":"","sources":["../../src/network/network-rm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAK9D,MAAM,CAAC,KAAK,UAAU,eAAe,CACpC,QAAkB,EAClB,OAAgC;IAEhC,MAAM,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
export type DockerContainerId = string;
|
|
2
2
|
export type DockerContainerName = string;
|
|
3
|
+
export type DockerImageId = string;
|
|
4
|
+
/** Options every docker command accepts, whatever its subcommand. */
|
|
5
|
+
export type DockerCommonOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The docker context to run against, as `docker --context` takes it.
|
|
8
|
+
*
|
|
9
|
+
* Naming the context per command leaves the daemon the rest of the machine
|
|
10
|
+
* talks to alone, which `docker context use` would not.
|
|
11
|
+
*/
|
|
12
|
+
context?: string;
|
|
13
|
+
};
|
|
3
14
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACzC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG;IACjC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/cmd-docker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Typed wrapper over the docker CLI: invocation plus output parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"prepack": "yarn build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@ac-kit/
|
|
42
|
-
"@ac-kit/node": "^0.
|
|
41
|
+
"@ac-kit/format-shell": "^0.1.0",
|
|
42
|
+
"@ac-kit/node": "^0.2.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@ac-kit/tsconfig": "0.1.0",
|
|
46
46
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
47
|
-
"@ac-kit/vitest-config": "0.1.
|
|
47
|
+
"@ac-kit/vitest-config": "0.1.1",
|
|
48
48
|
"@types/node": "26.5.1",
|
|
49
49
|
"@typescript/native": "typescript@7.0.2",
|
|
50
50
|
"rimraf": "6.1.3",
|