@procedures/docker 0.0.0-stage → 0.1.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +752 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/index.d.ts +35 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +35 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/module.d.ts +16 -0
  10. package/dist/module.d.ts.map +1 -0
  11. package/dist/module.js +183 -0
  12. package/dist/module.js.map +1 -0
  13. package/dist/procedures/docker/build.d.ts +12 -0
  14. package/dist/procedures/docker/build.d.ts.map +1 -0
  15. package/dist/procedures/docker/build.js +34 -0
  16. package/dist/procedures/docker/build.js.map +1 -0
  17. package/dist/procedures/docker/down.d.ts +12 -0
  18. package/dist/procedures/docker/down.d.ts.map +1 -0
  19. package/dist/procedures/docker/down.js +25 -0
  20. package/dist/procedures/docker/down.js.map +1 -0
  21. package/dist/procedures/docker/exec.d.ts +12 -0
  22. package/dist/procedures/docker/exec.d.ts.map +1 -0
  23. package/dist/procedures/docker/exec.js +30 -0
  24. package/dist/procedures/docker/exec.js.map +1 -0
  25. package/dist/procedures/docker/index.d.ts +11 -0
  26. package/dist/procedures/docker/index.d.ts.map +1 -0
  27. package/dist/procedures/docker/index.js +11 -0
  28. package/dist/procedures/docker/index.js.map +1 -0
  29. package/dist/procedures/docker/logs.d.ts +16 -0
  30. package/dist/procedures/docker/logs.d.ts.map +1 -0
  31. package/dist/procedures/docker/logs.js +40 -0
  32. package/dist/procedures/docker/logs.js.map +1 -0
  33. package/dist/procedures/docker/ps.d.ts +12 -0
  34. package/dist/procedures/docker/ps.d.ts.map +1 -0
  35. package/dist/procedures/docker/ps.js +22 -0
  36. package/dist/procedures/docker/ps.js.map +1 -0
  37. package/dist/procedures/docker/pull.d.ts +12 -0
  38. package/dist/procedures/docker/pull.d.ts.map +1 -0
  39. package/dist/procedures/docker/pull.js +17 -0
  40. package/dist/procedures/docker/pull.js.map +1 -0
  41. package/dist/procedures/docker/rm.d.ts +12 -0
  42. package/dist/procedures/docker/rm.d.ts.map +1 -0
  43. package/dist/procedures/docker/rm.js +21 -0
  44. package/dist/procedures/docker/rm.js.map +1 -0
  45. package/dist/procedures/docker/run.d.ts +21 -0
  46. package/dist/procedures/docker/run.d.ts.map +1 -0
  47. package/dist/procedures/docker/run.js +56 -0
  48. package/dist/procedures/docker/run.js.map +1 -0
  49. package/dist/procedures/docker/shared.d.ts +23 -0
  50. package/dist/procedures/docker/shared.d.ts.map +1 -0
  51. package/dist/procedures/docker/shared.js +51 -0
  52. package/dist/procedures/docker/shared.js.map +1 -0
  53. package/dist/procedures/docker/stop.d.ts +12 -0
  54. package/dist/procedures/docker/stop.d.ts.map +1 -0
  55. package/dist/procedures/docker/stop.js +20 -0
  56. package/dist/procedures/docker/stop.js.map +1 -0
  57. package/dist/procedures/docker/up.d.ts +12 -0
  58. package/dist/procedures/docker/up.d.ts.map +1 -0
  59. package/dist/procedures/docker/up.js +28 -0
  60. package/dist/procedures/docker/up.js.map +1 -0
  61. package/dist/register.d.ts +9 -0
  62. package/dist/register.d.ts.map +1 -0
  63. package/dist/register.js +16 -0
  64. package/dist/register.js.map +1 -0
  65. package/dist/types.d.ts +130 -0
  66. package/dist/types.d.ts.map +1 -0
  67. package/dist/types.js +207 -0
  68. package/dist/types.js.map +1 -0
  69. package/package.json +81 -3
  70. package/src/index.ts +75 -0
  71. package/src/module.ts +237 -0
  72. package/src/procedures/docker/build.ts +46 -0
  73. package/src/procedures/docker/down.ts +31 -0
  74. package/src/procedures/docker/exec.ts +37 -0
  75. package/src/procedures/docker/index.ts +10 -0
  76. package/src/procedures/docker/logs.ts +52 -0
  77. package/src/procedures/docker/ps.ts +27 -0
  78. package/src/procedures/docker/pull.ts +23 -0
  79. package/src/procedures/docker/rm.ts +28 -0
  80. package/src/procedures/docker/run.ts +65 -0
  81. package/src/procedures/docker/shared.ts +62 -0
  82. package/src/procedures/docker/stop.ts +29 -0
  83. package/src/procedures/docker/up.ts +35 -0
  84. package/src/register.ts +20 -0
  85. package/src/types.ts +351 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,gGAAgG;AAChG,yEAAyE;AAEzE,yEAAyE;AACzE,MAAM,CAAC,MAAM,yBAAyB,GAAmC,CAAC,CAAC,WAAW,CAAC;IACrF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;IACvE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IAC5D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IAC3G,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC7D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC1E,CAAC,CAAC;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,sBAAsB,GAAmD,CAAC,CAAC,KAAK,CAAC;IAC5F,yBAAyB;IACzB,CAAC,CAAC,WAAW,CAAC;QACZ,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC;QACrE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACvE,CAAC;IACF,CAAC,CAAC,WAAW,CAAC;QACZ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,uBAA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CAAC;IACxD,8BAA8B;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;CACnE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,84 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/package",
2
3
  "name": "@procedures/docker",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
4
+ "version": "0.1.0",
5
+ "description": "Docker and Docker Compose as typed procedures: ps, run, exec, logs (streaming), build, pull, stop, rm, compose up and down, run with argv and no shell injection.",
6
+ "keywords": [
7
+ "docker",
8
+ "docker-compose",
9
+ "containers",
10
+ "devops",
11
+ "automation",
12
+ "procedures"
13
+ ],
14
+ "homepage": "https://mark1russell7.github.io/client/",
15
+ "bugs": {
16
+ "url": "https://github.com/mark1russell7/client/issues"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/mark1russell7/client.git",
21
+ "directory": "packages/client-docker"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Mark Russell (https://github.com/mark1russell7)",
25
+ "type": "module",
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
33
+ "./module": {
34
+ "types": "./dist/module.d.ts",
35
+ "import": "./dist/module.js"
36
+ },
37
+ "./register.js": {
38
+ "import": "./dist/register.js"
39
+ }
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "src",
44
+ "!src/**/*.test.ts",
45
+ "!src/**/*.test.tsx",
46
+ "!src/**/__tests__",
47
+ "CHANGELOG.md"
48
+ ],
49
+ "sideEffects": [
50
+ "./dist/index.js",
51
+ "./dist/register.js"
52
+ ],
53
+ "engines": {
54
+ "node": ">=22"
55
+ },
56
+ "publishConfig": {
57
+ "access": "public",
58
+ "provenance": true
59
+ },
60
+ "dependencies": {
61
+ "@procedures/client": "0.1.0",
62
+ "@procedures/shell": "0.1.0",
63
+ "zod": "^4.6.5"
64
+ },
65
+ "devDependencies": {
66
+ "typescript": "^7.0.2",
67
+ "@mark1russell7/cue": "^1.0.0",
68
+ "vitest": "^5.0.3",
69
+ "@types/node": "^22.0.0"
70
+ },
71
+ "client": {
72
+ "procedures": "./dist/register.js"
73
+ },
74
+ "scripts": {
75
+ "build": "tsc -b",
76
+ "typecheck": "tsc --noEmit",
77
+ "clean": "rm -rf dist .tsbuildinfo",
78
+ "test": "vitest run --exclude '**/*.integration.test.ts'",
79
+ "test:watch": "vitest",
80
+ "test:unit": "vitest run --exclude '**/*.integration.test.ts'",
81
+ "test:integration": "vitest run __tests__/docker.integration.test.ts",
82
+ "test:coverage": "vitest run --coverage"
83
+ }
6
84
  }
package/src/index.ts ADDED
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @procedures/docker
3
+ *
4
+ * Wraps Docker CLI commands as procedures using client-shell.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { Client } from "@procedures/client";
9
+ *
10
+ * // Run a container
11
+ * await client.call(["docker", "run"], {
12
+ * image: "nginx:latest",
13
+ * name: "my-nginx",
14
+ * ports: ["8080:80"],
15
+ * detach: true,
16
+ * });
17
+ *
18
+ * // Build an image
19
+ * await client.call(["docker", "build"], {
20
+ * context: ".",
21
+ * tag: "my-app:latest",
22
+ * });
23
+ *
24
+ * // Docker compose up
25
+ * await client.call(["docker", "compose", "up"], {
26
+ * detach: true,
27
+ * });
28
+ * ```
29
+ */
30
+
31
+ // Types
32
+ export type {
33
+ DockerRunInput,
34
+ DockerBuildInput,
35
+ DockerPullInput,
36
+ DockerExecInput,
37
+ DockerStopInput,
38
+ DockerRmInput,
39
+ DockerPsInput,
40
+ DockerLogsInput,
41
+ DockerComposeUpInput,
42
+ DockerComposeDownInput,
43
+ DockerCommandOutput,
44
+ } from "./types.js";
45
+ export type { DockerLogItem } from "./procedures/docker/logs.js";
46
+
47
+ export {
48
+ DockerRunInputSchema,
49
+ DockerBuildInputSchema,
50
+ DockerPullInputSchema,
51
+ DockerExecInputSchema,
52
+ DockerStopInputSchema,
53
+ DockerRmInputSchema,
54
+ DockerPsInputSchema,
55
+ DockerLogsInputSchema,
56
+ DockerComposeUpInputSchema,
57
+ DockerComposeDownInputSchema,
58
+ } from "./types.js";
59
+
60
+ // Procedures
61
+ export {
62
+ dockerRun,
63
+ dockerBuild,
64
+ dockerPull,
65
+ dockerExec,
66
+ dockerStop,
67
+ dockerRm,
68
+ dockerPs,
69
+ dockerLogs,
70
+ dockerComposeUp,
71
+ dockerComposeDown,
72
+ } from "./procedures/docker/index.js";
73
+
74
+ // Registration
75
+ export { registerDockerProcedures } from "./register.js";
package/src/module.ts ADDED
@@ -0,0 +1,237 @@
1
+ /**
2
+ * Module (no side effects): the procedures of this package as data, for `createRegistry()`.
3
+ *
4
+ * Procedure Registration for Docker operations
5
+ *
6
+ * Provides docker.run, docker.build, docker.pull, docker.exec, docker.stop,
7
+ * docker.rm, docker.ps, docker.logs, docker.compose.up, docker.compose.down procedures.
8
+ */
9
+
10
+
11
+ import { createProcedure, zodAdapter, defineModule, type ProcedureModule } from "@procedures/client";
12
+ import shellModule from "@procedures/shell/module";
13
+ import {
14
+ dockerRun,
15
+ dockerBuild,
16
+ dockerPull,
17
+ dockerExec,
18
+ dockerStop,
19
+ dockerRm,
20
+ dockerPs,
21
+ dockerLogs,
22
+ dockerComposeUp,
23
+ dockerComposeDown,
24
+ } from "./procedures/docker/index.js";
25
+ import type { DockerLogItem } from "./procedures/docker/index.js";
26
+ import {
27
+ DockerRunInputSchema,
28
+ DockerBuildInputSchema,
29
+ DockerPullInputSchema,
30
+ DockerExecInputSchema,
31
+ DockerStopInputSchema,
32
+ DockerRmInputSchema,
33
+ DockerPsInputSchema,
34
+ DockerLogsInputSchema,
35
+ DockerComposeUpInputSchema,
36
+ DockerComposeDownInputSchema,
37
+ type DockerRunInput,
38
+ type DockerBuildInput,
39
+ type DockerPullInput,
40
+ type DockerExecInput,
41
+ type DockerStopInput,
42
+ type DockerRmInput,
43
+ type DockerPsInput,
44
+ type DockerLogsInput,
45
+ type DockerComposeUpInput,
46
+ type DockerComposeDownInput,
47
+ type DockerCommandOutput,
48
+ DockerCommandOutputSchema,
49
+ DockerLogsOutputSchema,
50
+ } from "./types.js";
51
+ import type { ProcedureContext } from "@procedures/client";
52
+
53
+ // =============================================================================
54
+ // Procedures
55
+ // =============================================================================
56
+
57
+ const dockerRunProcedure = createProcedure()
58
+ .path(["docker", "run"])
59
+ .input(zodAdapter<DockerRunInput>(DockerRunInputSchema))
60
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
61
+ .meta({
62
+ description: "Run a Docker container",
63
+ calls: ["shell.run"],
64
+ args: ["image"],
65
+ shorts: { name: "n", detach: "d" },
66
+ output: "json",
67
+ })
68
+ .handler(async (input: DockerRunInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
69
+ return dockerRun(input, ctx);
70
+ })
71
+ .build();
72
+
73
+ const dockerBuildProcedure = createProcedure()
74
+ .path(["docker", "build"])
75
+ .input(zodAdapter<DockerBuildInput>(DockerBuildInputSchema))
76
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
77
+ .meta({
78
+ description: "Build a Docker image",
79
+ calls: ["shell.run"],
80
+ args: ["context"],
81
+ shorts: { tag: "t", dockerfile: "f" },
82
+ output: "json",
83
+ })
84
+ .handler(async (input: DockerBuildInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
85
+ return dockerBuild(input, ctx);
86
+ })
87
+ .build();
88
+
89
+ const dockerPullProcedure = createProcedure()
90
+ .path(["docker", "pull"])
91
+ .input(zodAdapter<DockerPullInput>(DockerPullInputSchema))
92
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
93
+ .meta({
94
+ description: "Pull a Docker image",
95
+ calls: ["shell.run"],
96
+ args: ["image"],
97
+ output: "json",
98
+ })
99
+ .handler(async (input: DockerPullInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
100
+ return dockerPull(input, ctx);
101
+ })
102
+ .build();
103
+
104
+ const dockerExecProcedure = createProcedure()
105
+ .path(["docker", "exec"])
106
+ .input(zodAdapter<DockerExecInput>(DockerExecInputSchema))
107
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
108
+ .meta({
109
+ description: "Execute command in a running container",
110
+ calls: ["shell.run"],
111
+ args: ["container", "command"],
112
+ shorts: { interactive: "i", tty: "t", workdir: "w" },
113
+ output: "json",
114
+ })
115
+ .handler(async (input: DockerExecInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
116
+ return dockerExec(input, ctx);
117
+ })
118
+ .build();
119
+
120
+ const dockerStopProcedure = createProcedure()
121
+ .path(["docker", "stop"])
122
+ .input(zodAdapter<DockerStopInput>(DockerStopInputSchema))
123
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
124
+ .meta({
125
+ description: "Stop running container(s)",
126
+ calls: ["shell.run"],
127
+ args: ["containers"],
128
+ shorts: { time: "t" },
129
+ output: "json",
130
+ })
131
+ .handler(async (input: DockerStopInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
132
+ return dockerStop(input, ctx);
133
+ })
134
+ .build();
135
+
136
+ const dockerRmProcedure = createProcedure()
137
+ .path(["docker", "rm"])
138
+ .input(zodAdapter<DockerRmInput>(DockerRmInputSchema))
139
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
140
+ .meta({
141
+ description: "Remove container(s)",
142
+ calls: ["shell.run"],
143
+ args: ["containers"],
144
+ shorts: { force: "f", volumes: "v" },
145
+ output: "json",
146
+ })
147
+ .handler(async (input: DockerRmInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
148
+ return dockerRm(input, ctx);
149
+ })
150
+ .build();
151
+
152
+ const dockerPsProcedure = createProcedure()
153
+ .path(["docker", "ps"])
154
+ .input(zodAdapter<DockerPsInput>(DockerPsInputSchema))
155
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
156
+ .meta({
157
+ description: "List containers",
158
+ calls: ["shell.run"],
159
+ shorts: { all: "a", filter: "f", format: "F" },
160
+ output: "json",
161
+ })
162
+ .handler(async (input: DockerPsInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
163
+ return dockerPs(input, ctx);
164
+ })
165
+ .build();
166
+
167
+ const dockerLogsProcedure = createProcedure()
168
+ .path(["docker", "logs"])
169
+ .input(zodAdapter<DockerLogsInput>(DockerLogsInputSchema))
170
+ // One value, or with follow one item for each log line (a stream)
171
+ .output(zodAdapter<DockerCommandOutput | DockerLogItem>(DockerLogsOutputSchema))
172
+ .meta({
173
+ description: "Get container logs",
174
+ calls: ["shell.run", "shell.stream"],
175
+ args: ["container"],
176
+ shorts: { follow: "f", tail: "n", timestamps: "t" },
177
+ output: "json",
178
+ })
179
+ // With follow, the promise gives a stream: invokeProcedure reads a returned async iterable as a
180
+ // stream, and the handler types of the core do not describe that case
181
+ .handler((input: DockerLogsInput, ctx: ProcedureContext) =>
182
+ dockerLogs(input, ctx) as unknown as Promise<DockerCommandOutput | DockerLogItem>
183
+ )
184
+ .build();
185
+
186
+ const dockerComposeUpProcedure = createProcedure()
187
+ .path(["docker", "compose", "up"])
188
+ .input(zodAdapter<DockerComposeUpInput>(DockerComposeUpInputSchema))
189
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
190
+ .meta({
191
+ description: "Start services with docker compose",
192
+ calls: ["shell.run"],
193
+ shorts: { file: "f", detach: "d", build: "b" },
194
+ output: "json",
195
+ })
196
+ .handler(async (input: DockerComposeUpInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
197
+ return dockerComposeUp(input, ctx);
198
+ })
199
+ .build();
200
+
201
+ const dockerComposeDownProcedure = createProcedure()
202
+ .path(["docker", "compose", "down"])
203
+ .input(zodAdapter<DockerComposeDownInput>(DockerComposeDownInputSchema))
204
+ .output(zodAdapter<DockerCommandOutput>(DockerCommandOutputSchema))
205
+ .meta({
206
+ description: "Stop services with docker compose",
207
+ calls: ["shell.run"],
208
+ shorts: { file: "f", volumes: "v" },
209
+ output: "json",
210
+ })
211
+ .handler(async (input: DockerComposeDownInput, ctx: ProcedureContext): Promise<DockerCommandOutput> => {
212
+ return dockerComposeDown(input, ctx);
213
+ })
214
+ .build();
215
+
216
+ // =============================================================================
217
+ // Registration
218
+ // =============================================================================
219
+
220
+ /**
221
+ * The module of this package, for `createRegistry()`: its procedures as data. Importing this
222
+ * file registers nothing. (`register.ts` registers the same procedures in the global registry.)
223
+ */
224
+ export const dockerModule: ProcedureModule = defineModule("@procedures/docker", [
225
+ dockerRunProcedure,
226
+ dockerBuildProcedure,
227
+ dockerPullProcedure,
228
+ dockerExecProcedure,
229
+ dockerStopProcedure,
230
+ dockerRmProcedure,
231
+ dockerPsProcedure,
232
+ dockerLogsProcedure,
233
+ dockerComposeUpProcedure,
234
+ dockerComposeDownProcedure,
235
+ ], [shellModule]);
236
+
237
+ export default dockerModule;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * docker.build procedure
3
+ *
4
+ * Build a Docker image.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker } from "./shared.js";
9
+ import type { DockerBuildInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Build a Docker image
13
+ */
14
+ export async function dockerBuild(
15
+ input: DockerBuildInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["build"];
20
+
21
+ // Add tag
22
+ args.push("-t", input.tag);
23
+
24
+ // Add dockerfile if specified
25
+ if (input.dockerfile) {
26
+ args.push("-f", input.dockerfile);
27
+ }
28
+
29
+ // Add build args
30
+ if (input.buildArgs) {
31
+ for (const [key, value] of Object.entries(input.buildArgs)) {
32
+ args.push("--build-arg", `${key}=${value}`);
33
+ }
34
+ }
35
+
36
+ // Add no-cache flag
37
+ if (input.noCache) {
38
+ args.push("--no-cache");
39
+ }
40
+
41
+ // Add context
42
+ args.push(dockerArg("context", input.context));
43
+
44
+ return runDocker(args, input, ctx);
45
+ }
46
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * docker.compose.down procedure
3
+ *
4
+ * Stop services with docker compose.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { runDocker } from "./shared.js";
9
+ import type { DockerComposeDownInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Stop services with docker compose
13
+ */
14
+ export async function dockerComposeDown(
15
+ input: DockerComposeDownInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["compose"];
20
+
21
+ if (input.file) args.push("-f", input.file);
22
+
23
+ args.push("down");
24
+
25
+ if (input.volumes) args.push("-v");
26
+ if (input.removeOrphans) args.push("--remove-orphans");
27
+ if (input.rmi) args.push("--rmi", input.rmi);
28
+
29
+ return runDocker(args, input, ctx);
30
+ }
31
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * docker.exec procedure
3
+ *
4
+ * Execute command in a running container.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker, words } from "./shared.js";
9
+ import type { DockerExecInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Execute command in container
13
+ */
14
+ export async function dockerExec(
15
+ input: DockerExecInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["exec"];
20
+
21
+ if (input.interactive) args.push("-i");
22
+ if (input.tty) args.push("-t");
23
+ if (input.workdir) args.push("-w", input.workdir);
24
+
25
+ // Add environment variables
26
+ if (input.env) {
27
+ for (const [key, value] of Object.entries(input.env)) {
28
+ args.push("-e", `${key}=${value}`);
29
+ }
30
+ }
31
+
32
+ args.push(dockerArg("container", input.container));
33
+ args.push(...words(input.command));
34
+
35
+ return runDocker(args, input, ctx);
36
+ }
37
+ }
@@ -0,0 +1,10 @@
1
+ export { dockerRun } from "./run.js";
2
+ export { dockerBuild } from "./build.js";
3
+ export { dockerPull } from "./pull.js";
4
+ export { dockerExec } from "./exec.js";
5
+ export { dockerStop } from "./stop.js";
6
+ export { dockerRm } from "./rm.js";
7
+ export { dockerPs } from "./ps.js";
8
+ export { dockerLogs, type DockerLogItem } from "./logs.js";
9
+ export { dockerComposeUp } from "./up.js";
10
+ export { dockerComposeDown } from "./down.js";
@@ -0,0 +1,52 @@
1
+ /**
2
+ * docker.logs procedure
3
+ *
4
+ * Get container logs. With `follow`, the procedure is a stream: each log line is an item while
5
+ * the container runs. The stream ends when the reader stops or the signal aborts, and that ends
6
+ * `docker logs -f`. Before, `follow` waited for docker to end, so the call gave nothing until a
7
+ * timeout or a cancel.
8
+ */
9
+
10
+ import type { ProcedureContext } from "@procedures/client";
11
+ import { dockerArg, runDocker } from "./shared.js";
12
+ import type { DockerLogsInput, DockerCommandOutput, DockerLogItem } from "../../types.js";
13
+
14
+ // The type lives in types.ts, next to its output schema
15
+ export type { DockerLogItem };
16
+
17
+ /**
18
+ * Get container logs: one value, or with `follow` a stream of lines
19
+ */
20
+ export async function dockerLogs(
21
+ input: DockerLogsInput,
22
+ ctx: ProcedureContext
23
+ ): Promise<DockerCommandOutput | AsyncGenerator<DockerLogItem, void, undefined>> {
24
+ const args: string[] = ["logs"];
25
+
26
+ if (input.follow) args.push("-f");
27
+ if (input.tail !== undefined) args.push("--tail", String(input.tail));
28
+ if (input.timestamps) args.push("-t");
29
+
30
+ // The guard runs before anything starts, also for a stream
31
+ args.push(dockerArg("container", input.container));
32
+
33
+ if (input.follow) {
34
+ return followLogs(args, input, ctx);
35
+ }
36
+ return runDocker(args, input, ctx);
37
+ }
38
+
39
+ /** The lines of `docker <args>` through shell.stream, which runs no shell and ends the program when the reader stops. */
40
+ async function* followLogs(
41
+ args: string[],
42
+ input: DockerLogsInput,
43
+ ctx: ProcedureContext
44
+ ): AsyncGenerator<DockerLogItem, void, undefined> {
45
+ const shellInput: { command: string; args: string[]; cwd?: string; timeout?: number } = { command: "docker", args };
46
+ if (input.cwd !== undefined) shellInput.cwd = input.cwd;
47
+ if (input.timeout !== undefined) shellInput.timeout = input.timeout;
48
+ if (!ctx.client.stream) {
49
+ throw new Error("docker.logs with follow needs a host whose client can stream");
50
+ }
51
+ yield* ctx.client.stream<typeof shellInput, DockerLogItem>(["shell", "stream"], shellInput);
52
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * docker.ps procedure
3
+ *
4
+ * List containers.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { runDocker } from "./shared.js";
9
+ import type { DockerPsInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * List containers
13
+ */
14
+ export async function dockerPs(
15
+ input: DockerPsInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["ps"];
20
+
21
+ if (input.all) args.push("-a");
22
+ if (input.filter) args.push("--filter", input.filter);
23
+ if (input.format) args.push("--format", input.format);
24
+
25
+ return runDocker(args, input, ctx);
26
+ }
27
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * docker.pull procedure
3
+ *
4
+ * Pull a Docker image.
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker } from "./shared.js";
9
+ import type { DockerPullInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Pull a Docker image
13
+ */
14
+ export async function dockerPull(
15
+ input: DockerPullInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const imageWithTag = input.tag ? `${input.image}:${input.tag}` : input.image;
20
+ const args = ["pull", dockerArg("image", imageWithTag)];
21
+ return runDocker(args, input, ctx);
22
+ }
23
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * docker.rm procedure
3
+ *
4
+ * Remove container(s).
5
+ */
6
+
7
+ import type { ProcedureContext } from "@procedures/client";
8
+ import { dockerArg, runDocker } from "./shared.js";
9
+ import type { DockerRmInput, DockerCommandOutput } from "../../types.js";
10
+
11
+ /**
12
+ * Remove container(s)
13
+ */
14
+ export async function dockerRm(
15
+ input: DockerRmInput,
16
+ ctx: ProcedureContext
17
+ ): Promise<DockerCommandOutput> {
18
+ {
19
+ const args: string[] = ["rm"];
20
+
21
+ if (input.force) args.push("-f");
22
+ if (input.volumes) args.push("-v");
23
+
24
+ args.push(...input.containers.map((c) => dockerArg("container", c)));
25
+
26
+ return runDocker(args, input, ctx);
27
+ }
28
+ }