@supernova123/docker-mcp-server 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.
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/docker.d.ts +12 -0
- package/dist/docker.js +58 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +24 -0
- package/dist/tools/compose.d.ts +3 -0
- package/dist/tools/compose.js +95 -0
- package/dist/tools/container.d.ts +4 -0
- package/dist/tools/container.js +140 -0
- package/dist/tools/exec.d.ts +4 -0
- package/dist/tools/exec.js +39 -0
- package/dist/tools/health.d.ts +4 -0
- package/dist/tools/health.js +129 -0
- package/dist/tools/image.d.ts +4 -0
- package/dist/tools/image.js +67 -0
- package/dist/tools/logs.d.ts +4 -0
- package/dist/tools/logs.js +69 -0
- package/dist/tools/network.d.ts +4 -0
- package/dist/tools/network.js +47 -0
- package/dist/types.d.ts +309 -0
- package/dist/types.js +128 -0
- package/package.json +48 -0
- package/src/docker.ts +65 -0
- package/src/index.ts +20 -0
- package/src/server.ts +27 -0
- package/src/tools/compose.ts +114 -0
- package/src/tools/container.ts +193 -0
- package/src/tools/exec.ts +48 -0
- package/src/tools/health.ts +150 -0
- package/src/tools/image.ts +92 -0
- package/src/tools/logs.ts +85 -0
- package/src/tools/network.ts +60 -0
- package/src/types.ts +152 -0
- package/tests/container.test.ts +192 -0
- package/tests/image.test.ts +160 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { CheckHealthSchema, WatchHealthSchema, SetRestartPolicySchema } from "../types.js";
|
|
2
|
+
import { formatError } from "../docker.js";
|
|
3
|
+
export function registerHealthTools(server, docker) {
|
|
4
|
+
server.tool("check_health", "Run a health probe against a container. Supports HTTP, TCP, and exec probes. Auto-detects from container HEALTHCHECK if available.", CheckHealthSchema.shape, async (params) => {
|
|
5
|
+
try {
|
|
6
|
+
const container = docker.getContainer(params.container_id);
|
|
7
|
+
const info = await container.inspect();
|
|
8
|
+
// Check if container has HEALTHCHECK
|
|
9
|
+
const healthcheck = info.Config.Healthcheck;
|
|
10
|
+
let probeType = params.type;
|
|
11
|
+
let endpoint = params.endpoint;
|
|
12
|
+
let command = params.command;
|
|
13
|
+
if (!probeType && healthcheck?.Test?.length) {
|
|
14
|
+
const test = healthcheck.Test[0];
|
|
15
|
+
if (test.startsWith("CMD ")) {
|
|
16
|
+
probeType = "exec";
|
|
17
|
+
command = test.slice(4).split(" ");
|
|
18
|
+
}
|
|
19
|
+
else if (test.startsWith("CMD-SHELL ")) {
|
|
20
|
+
probeType = "exec";
|
|
21
|
+
command = ["sh", "-c", test.slice(10)];
|
|
22
|
+
}
|
|
23
|
+
else if (test === "NONE") {
|
|
24
|
+
probeType = undefined;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!probeType) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: "No health check configured for this container and no probe type specified." }],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (probeType === "exec" && command) {
|
|
33
|
+
const exec = await container.exec({
|
|
34
|
+
Cmd: command,
|
|
35
|
+
AttachStdout: true,
|
|
36
|
+
AttachStderr: true,
|
|
37
|
+
});
|
|
38
|
+
const stream = await exec.start({});
|
|
39
|
+
const output = await new Promise((resolve) => {
|
|
40
|
+
let data = "";
|
|
41
|
+
stream.on("data", (chunk) => { data += chunk.toString(); });
|
|
42
|
+
stream.on("end", () => resolve(data));
|
|
43
|
+
});
|
|
44
|
+
const inspect = await exec.inspect();
|
|
45
|
+
return {
|
|
46
|
+
content: [{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: JSON.stringify({
|
|
49
|
+
healthy: inspect.ExitCode === 0,
|
|
50
|
+
exitCode: inspect.ExitCode,
|
|
51
|
+
output: output.trim(),
|
|
52
|
+
}, null, 2),
|
|
53
|
+
}],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
content: [{ type: "text", text: `Health probe type '${probeType}' is not yet implemented in v1. Use exec probes or check container HEALTHCHECK directly.` }],
|
|
58
|
+
isError: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
server.tool("watch_health", "Poll a container's health status until it becomes healthy or times out. Useful for waiting on service startup.", WatchHealthSchema.shape, async (params) => {
|
|
66
|
+
try {
|
|
67
|
+
const container = docker.getContainer(params.container_id);
|
|
68
|
+
const timeout = (params.timeout ?? 60) * 1000;
|
|
69
|
+
const interval = (params.interval ?? 5) * 1000;
|
|
70
|
+
const start = Date.now();
|
|
71
|
+
while (Date.now() - start < timeout) {
|
|
72
|
+
const info = await container.inspect();
|
|
73
|
+
const health = info.State.Health;
|
|
74
|
+
if (health?.Status === "healthy") {
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: JSON.stringify({ healthy: true, status: "healthy", waitTime: Date.now() - start }, null, 2) }],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
if (health?.Status === "unhealthy") {
|
|
80
|
+
const lastLog = health.Log?.[health.Log.length - 1];
|
|
81
|
+
return {
|
|
82
|
+
content: [{
|
|
83
|
+
type: "text",
|
|
84
|
+
text: JSON.stringify({
|
|
85
|
+
healthy: false,
|
|
86
|
+
status: "unhealthy",
|
|
87
|
+
exitCode: lastLog?.ExitCode,
|
|
88
|
+
output: lastLog?.Output?.trim(),
|
|
89
|
+
}, null, 2),
|
|
90
|
+
}],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
await new Promise((resolve) => setTimeout(resolve, interval));
|
|
94
|
+
}
|
|
95
|
+
const info = await container.inspect();
|
|
96
|
+
return {
|
|
97
|
+
content: [{
|
|
98
|
+
type: "text",
|
|
99
|
+
text: JSON.stringify({
|
|
100
|
+
healthy: false,
|
|
101
|
+
status: "timeout",
|
|
102
|
+
containerHealth: info.State.Health?.Status ?? "no healthcheck",
|
|
103
|
+
}, null, 2),
|
|
104
|
+
}],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
server.tool("set_restart_policy", "Change the restart policy of a running container without recreating it.", SetRestartPolicySchema.shape, async (params) => {
|
|
112
|
+
try {
|
|
113
|
+
const container = docker.getContainer(params.container_id);
|
|
114
|
+
await container.update({
|
|
115
|
+
RestartPolicy: {
|
|
116
|
+
Name: params.policy,
|
|
117
|
+
MaximumRetryCount: params.max_retry_count ?? 0,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
content: [{ type: "text", text: `Restart policy set to '${params.policy}' for container ${params.container_id}.` }],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ListImagesSchema, PullImageSchema, BuildImageSchema, RemoveImageSchema, } from "../types.js";
|
|
2
|
+
import { formatImage, formatError } from "../docker.js";
|
|
3
|
+
export function registerImageTools(server, docker) {
|
|
4
|
+
server.tool("list_images", "List Docker images with optional filters. Returns image IDs, tags, sizes, and creation dates.", ListImagesSchema.shape, async (params) => {
|
|
5
|
+
try {
|
|
6
|
+
const images = await docker.listImages({
|
|
7
|
+
all: params.all ?? false,
|
|
8
|
+
filters: params.filter ? JSON.stringify({ reference: [params.filter] }) : undefined,
|
|
9
|
+
});
|
|
10
|
+
const results = images.map(formatImage);
|
|
11
|
+
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
server.tool("pull_image", "Pull a Docker image from a registry. Returns pull progress events.", PullImageSchema.shape, async (params) => {
|
|
18
|
+
try {
|
|
19
|
+
const imageRef = params.tag ? `${params.image}:${params.tag}` : params.image;
|
|
20
|
+
const stream = await docker.pull(imageRef);
|
|
21
|
+
// Wait for pull to complete
|
|
22
|
+
await new Promise((resolve, reject) => {
|
|
23
|
+
docker.modem.followProgress(stream, (err) => {
|
|
24
|
+
if (err)
|
|
25
|
+
reject(err);
|
|
26
|
+
else
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return { content: [{ type: "text", text: `Image ${imageRef} pulled successfully.` }] };
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
server.tool("build_image", "Build a Docker image from a Dockerfile or build context path.", BuildImageSchema.shape, async (params) => {
|
|
37
|
+
try {
|
|
38
|
+
const stream = await docker.buildImage({
|
|
39
|
+
context: params.context,
|
|
40
|
+
src: [params.dockerfile ?? "Dockerfile"],
|
|
41
|
+
}, { t: params.tag, dockerfile: params.dockerfile, buildargs: params.build_args, target: params.target });
|
|
42
|
+
await new Promise((resolve, reject) => {
|
|
43
|
+
docker.modem.followProgress(stream, (err) => {
|
|
44
|
+
if (err)
|
|
45
|
+
reject(err);
|
|
46
|
+
else
|
|
47
|
+
resolve();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
return { content: [{ type: "text", text: `Image ${params.tag} built successfully.` }] };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
server.tool("remove_image", "Remove a Docker image by name or ID. Use force to remove even if tagged.", RemoveImageSchema.shape, async (params) => {
|
|
57
|
+
try {
|
|
58
|
+
const image = docker.getImage(params.image);
|
|
59
|
+
await image.remove({ force: params.force ?? false });
|
|
60
|
+
return { content: [{ type: "text", text: `Image ${params.image} removed.` }] };
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=image.js.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { StreamLogsSchema, ContainerStatsSchema } from "../types.js";
|
|
2
|
+
import { formatError, formatBytes } from "../docker.js";
|
|
3
|
+
export function registerLogsTools(server, docker) {
|
|
4
|
+
server.tool("stream_logs", "Get logs from a Docker container. Supports tail count, timestamp filtering, and follow mode.", StreamLogsSchema.shape, async (params) => {
|
|
5
|
+
try {
|
|
6
|
+
const container = docker.getContainer(params.container_id);
|
|
7
|
+
const logs = await container.logs({
|
|
8
|
+
stdout: true,
|
|
9
|
+
stderr: true,
|
|
10
|
+
tail: params.tail ?? 100,
|
|
11
|
+
since: params.since ? Math.floor(new Date(params.since).getTime() / 1000) : undefined,
|
|
12
|
+
follow: false,
|
|
13
|
+
});
|
|
14
|
+
// Dockerode returns a Buffer with multiplexed stream headers
|
|
15
|
+
const output = logs.toString("utf-8").replace(/^[\x00-\x0f]{8}/gm, "");
|
|
16
|
+
return { content: [{ type: "text", text: output || "No logs found." }] };
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
server.tool("container_stats", "Get real-time resource usage statistics for a Docker container (CPU, memory, network, I/O).", ContainerStatsSchema.shape, async (params) => {
|
|
23
|
+
try {
|
|
24
|
+
const container = docker.getContainer(params.container_id);
|
|
25
|
+
const stats = await container.stats({ stream: false });
|
|
26
|
+
const cpuDelta = stats.cpu_stats.cpu_usage.total_usage - (stats.precpu_stats?.cpu_usage?.total_usage ?? 0);
|
|
27
|
+
const systemDelta = stats.cpu_stats.system_cpu_usage - (stats.precpu_stats?.system_cpu_usage ?? 0);
|
|
28
|
+
const cpuCount = stats.cpu_stats.online_cpus ?? 1;
|
|
29
|
+
const cpuPercent = systemDelta > 0 ? (cpuDelta / systemDelta) * cpuCount * 100 : 0;
|
|
30
|
+
const memUsage = stats.memory_stats.usage ?? 0;
|
|
31
|
+
const memLimit = stats.memory_stats.limit ?? 0;
|
|
32
|
+
const memPercent = memLimit > 0 ? (memUsage / memLimit) * 100 : 0;
|
|
33
|
+
return {
|
|
34
|
+
content: [{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: JSON.stringify({
|
|
37
|
+
name: params.container_id,
|
|
38
|
+
cpu: {
|
|
39
|
+
percent: parseFloat(cpuPercent.toFixed(2)),
|
|
40
|
+
cores: cpuCount,
|
|
41
|
+
},
|
|
42
|
+
memory: {
|
|
43
|
+
usage: formatBytes(memUsage),
|
|
44
|
+
limit: formatBytes(memLimit),
|
|
45
|
+
percent: parseFloat(memPercent.toFixed(2)),
|
|
46
|
+
},
|
|
47
|
+
network: stats.networks
|
|
48
|
+
? Object.fromEntries(Object.entries(stats.networks).map(([iface, data]) => [
|
|
49
|
+
iface,
|
|
50
|
+
{
|
|
51
|
+
rx: formatBytes(data.rx_bytes ?? 0),
|
|
52
|
+
tx: formatBytes(data.tx_bytes ?? 0),
|
|
53
|
+
},
|
|
54
|
+
]))
|
|
55
|
+
: {},
|
|
56
|
+
blockIO: {
|
|
57
|
+
read: formatBytes(stats.blkio_stats?.io_service_bytes?.[0]?.value ?? 0),
|
|
58
|
+
write: formatBytes(stats.blkio_stats?.io_service_bytes?.[1]?.value ?? 0),
|
|
59
|
+
},
|
|
60
|
+
}, null, 2),
|
|
61
|
+
}],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=logs.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ListNetworksSchema, ListVolumesSchema } from "../types.js";
|
|
2
|
+
import { formatError } from "../docker.js";
|
|
3
|
+
export function registerNetworkTools(server, docker) {
|
|
4
|
+
server.tool("list_networks", "List Docker networks with optional filter. Returns network IDs, names, drivers, and scopes.", ListNetworksSchema.shape, async (params) => {
|
|
5
|
+
try {
|
|
6
|
+
const networks = await docker.listNetworks({
|
|
7
|
+
filters: params.filter ? JSON.stringify({ name: [params.filter] }) : undefined,
|
|
8
|
+
});
|
|
9
|
+
const results = networks.map((n) => ({
|
|
10
|
+
id: n.Id.substring(0, 12),
|
|
11
|
+
name: n.Name,
|
|
12
|
+
driver: n.Driver,
|
|
13
|
+
scope: n.Scope,
|
|
14
|
+
created: n.Created,
|
|
15
|
+
containers: n.Containers
|
|
16
|
+
? Object.fromEntries(Object.entries(n.Containers).map(([id, c]) => [
|
|
17
|
+
id.substring(0, 12),
|
|
18
|
+
{ name: c.Name, ipv4: c.IPv4Address },
|
|
19
|
+
]))
|
|
20
|
+
: {},
|
|
21
|
+
}));
|
|
22
|
+
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
server.tool("list_volumes", "List Docker volumes with optional filter. Returns volume names, drivers, mount points, and labels.", ListVolumesSchema.shape, async (params) => {
|
|
29
|
+
try {
|
|
30
|
+
const result = await docker.listVolumes({
|
|
31
|
+
filters: params.filter ? JSON.stringify({ name: [params.filter] }) : undefined,
|
|
32
|
+
});
|
|
33
|
+
const volumes = (result.Volumes || []).map((v) => ({
|
|
34
|
+
name: v.Name,
|
|
35
|
+
driver: v.Driver,
|
|
36
|
+
mountpoint: v.Mountpoint,
|
|
37
|
+
created: v.CreatedAt ?? v.Created,
|
|
38
|
+
labels: v.Labels,
|
|
39
|
+
}));
|
|
40
|
+
return { content: [{ type: "text", text: JSON.stringify(volumes, null, 2) }] };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return { content: [{ type: "text", text: `Error: ${formatError(error)}` }], isError: true };
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=network.js.map
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ListContainersSchema: z.ZodObject<{
|
|
3
|
+
all: z.ZodOptional<z.ZodBoolean>;
|
|
4
|
+
label: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
5
|
+
name: z.ZodOptional<z.ZodString>;
|
|
6
|
+
state: z.ZodOptional<z.ZodEnum<["running", "stopped", "paused", "exited", "created", "restarting"]>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
state?: "created" | "running" | "stopped" | "paused" | "exited" | "restarting" | undefined;
|
|
10
|
+
all?: boolean | undefined;
|
|
11
|
+
label?: string[] | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
state?: "created" | "running" | "stopped" | "paused" | "exited" | "restarting" | undefined;
|
|
15
|
+
all?: boolean | undefined;
|
|
16
|
+
label?: string[] | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const InspectContainerSchema: z.ZodObject<{
|
|
19
|
+
container_id: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
container_id: string;
|
|
22
|
+
}, {
|
|
23
|
+
container_id: string;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const StartContainerSchema: z.ZodObject<{
|
|
26
|
+
container_id: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
container_id: string;
|
|
29
|
+
}, {
|
|
30
|
+
container_id: string;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const StopContainerSchema: z.ZodObject<{
|
|
33
|
+
container_id: z.ZodString;
|
|
34
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
container_id: string;
|
|
37
|
+
timeout?: number | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
container_id: string;
|
|
40
|
+
timeout?: number | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const RestartContainerSchema: z.ZodObject<{
|
|
43
|
+
container_id: z.ZodString;
|
|
44
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
container_id: string;
|
|
47
|
+
timeout?: number | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
container_id: string;
|
|
50
|
+
timeout?: number | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const RemoveContainerSchema: z.ZodObject<{
|
|
53
|
+
container_id: z.ZodString;
|
|
54
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
container_id: string;
|
|
57
|
+
force?: boolean | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
container_id: string;
|
|
60
|
+
force?: boolean | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
export declare const RecreateContainerSchema: z.ZodObject<{
|
|
63
|
+
container_id: z.ZodString;
|
|
64
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
container_id: string;
|
|
67
|
+
timeout?: number | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
container_id: string;
|
|
70
|
+
timeout?: number | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export declare const RunContainerSchema: z.ZodObject<{
|
|
73
|
+
image: z.ZodString;
|
|
74
|
+
name: z.ZodOptional<z.ZodString>;
|
|
75
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
76
|
+
ports: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
77
|
+
volumes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
78
|
+
restart_policy: z.ZodOptional<z.ZodEnum<["no", "always", "unless-stopped", "on-failure"]>>;
|
|
79
|
+
command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
|
+
detach: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
image: string;
|
|
83
|
+
name?: string | undefined;
|
|
84
|
+
ports?: Record<string, string> | undefined;
|
|
85
|
+
env?: Record<string, string> | undefined;
|
|
86
|
+
volumes?: string[] | undefined;
|
|
87
|
+
restart_policy?: "no" | "always" | "unless-stopped" | "on-failure" | undefined;
|
|
88
|
+
command?: string[] | undefined;
|
|
89
|
+
detach?: boolean | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
image: string;
|
|
92
|
+
name?: string | undefined;
|
|
93
|
+
ports?: Record<string, string> | undefined;
|
|
94
|
+
env?: Record<string, string> | undefined;
|
|
95
|
+
volumes?: string[] | undefined;
|
|
96
|
+
restart_policy?: "no" | "always" | "unless-stopped" | "on-failure" | undefined;
|
|
97
|
+
command?: string[] | undefined;
|
|
98
|
+
detach?: boolean | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const ListImagesSchema: z.ZodObject<{
|
|
101
|
+
all: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
filter?: string | undefined;
|
|
105
|
+
all?: boolean | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
filter?: string | undefined;
|
|
108
|
+
all?: boolean | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
export declare const PullImageSchema: z.ZodObject<{
|
|
111
|
+
image: z.ZodString;
|
|
112
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, "strip", z.ZodTypeAny, {
|
|
114
|
+
image: string;
|
|
115
|
+
tag?: string | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
image: string;
|
|
118
|
+
tag?: string | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
export declare const BuildImageSchema: z.ZodObject<{
|
|
121
|
+
context: z.ZodString;
|
|
122
|
+
tag: z.ZodString;
|
|
123
|
+
dockerfile: z.ZodOptional<z.ZodString>;
|
|
124
|
+
build_args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
125
|
+
target: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
tag: string;
|
|
128
|
+
context: string;
|
|
129
|
+
dockerfile?: string | undefined;
|
|
130
|
+
build_args?: Record<string, string> | undefined;
|
|
131
|
+
target?: string | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
tag: string;
|
|
134
|
+
context: string;
|
|
135
|
+
dockerfile?: string | undefined;
|
|
136
|
+
build_args?: Record<string, string> | undefined;
|
|
137
|
+
target?: string | undefined;
|
|
138
|
+
}>;
|
|
139
|
+
export declare const RemoveImageSchema: z.ZodObject<{
|
|
140
|
+
image: z.ZodString;
|
|
141
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
image: string;
|
|
144
|
+
force?: boolean | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
image: string;
|
|
147
|
+
force?: boolean | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
export declare const ComposeUpSchema: z.ZodObject<{
|
|
150
|
+
path: z.ZodString;
|
|
151
|
+
build: z.ZodOptional<z.ZodBoolean>;
|
|
152
|
+
detach: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
services: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
path: string;
|
|
156
|
+
detach?: boolean | undefined;
|
|
157
|
+
build?: boolean | undefined;
|
|
158
|
+
services?: string[] | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
path: string;
|
|
161
|
+
detach?: boolean | undefined;
|
|
162
|
+
build?: boolean | undefined;
|
|
163
|
+
services?: string[] | undefined;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const ComposeDownSchema: z.ZodObject<{
|
|
166
|
+
path: z.ZodString;
|
|
167
|
+
volumes: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
path: string;
|
|
171
|
+
timeout?: number | undefined;
|
|
172
|
+
volumes?: boolean | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
path: string;
|
|
175
|
+
timeout?: number | undefined;
|
|
176
|
+
volumes?: boolean | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export declare const ComposePsSchema: z.ZodObject<{
|
|
179
|
+
path: z.ZodString;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
path: string;
|
|
182
|
+
}, {
|
|
183
|
+
path: string;
|
|
184
|
+
}>;
|
|
185
|
+
export declare const ComposeLogsSchema: z.ZodObject<{
|
|
186
|
+
path: z.ZodString;
|
|
187
|
+
services: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
188
|
+
tail: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
follow: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
path: string;
|
|
192
|
+
services?: string[] | undefined;
|
|
193
|
+
tail?: number | undefined;
|
|
194
|
+
follow?: boolean | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
path: string;
|
|
197
|
+
services?: string[] | undefined;
|
|
198
|
+
tail?: number | undefined;
|
|
199
|
+
follow?: boolean | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
export declare const ComposeRestartSchema: z.ZodObject<{
|
|
202
|
+
path: z.ZodString;
|
|
203
|
+
services: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
204
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
path: string;
|
|
207
|
+
timeout?: number | undefined;
|
|
208
|
+
services?: string[] | undefined;
|
|
209
|
+
}, {
|
|
210
|
+
path: string;
|
|
211
|
+
timeout?: number | undefined;
|
|
212
|
+
services?: string[] | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
export declare const CheckHealthSchema: z.ZodObject<{
|
|
215
|
+
container_id: z.ZodString;
|
|
216
|
+
type: z.ZodOptional<z.ZodEnum<["http", "tcp", "exec"]>>;
|
|
217
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
218
|
+
command: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
container_id: string;
|
|
221
|
+
type?: "http" | "tcp" | "exec" | undefined;
|
|
222
|
+
command?: string[] | undefined;
|
|
223
|
+
endpoint?: string | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
container_id: string;
|
|
226
|
+
type?: "http" | "tcp" | "exec" | undefined;
|
|
227
|
+
command?: string[] | undefined;
|
|
228
|
+
endpoint?: string | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
export declare const WatchHealthSchema: z.ZodObject<{
|
|
231
|
+
container_id: z.ZodString;
|
|
232
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
interval: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
container_id: string;
|
|
236
|
+
timeout?: number | undefined;
|
|
237
|
+
interval?: number | undefined;
|
|
238
|
+
}, {
|
|
239
|
+
container_id: string;
|
|
240
|
+
timeout?: number | undefined;
|
|
241
|
+
interval?: number | undefined;
|
|
242
|
+
}>;
|
|
243
|
+
export declare const SetRestartPolicySchema: z.ZodObject<{
|
|
244
|
+
container_id: z.ZodString;
|
|
245
|
+
policy: z.ZodEnum<["no", "always", "unless-stopped", "on-failure"]>;
|
|
246
|
+
max_retry_count: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
}, "strip", z.ZodTypeAny, {
|
|
248
|
+
container_id: string;
|
|
249
|
+
policy: "no" | "always" | "unless-stopped" | "on-failure";
|
|
250
|
+
max_retry_count?: number | undefined;
|
|
251
|
+
}, {
|
|
252
|
+
container_id: string;
|
|
253
|
+
policy: "no" | "always" | "unless-stopped" | "on-failure";
|
|
254
|
+
max_retry_count?: number | undefined;
|
|
255
|
+
}>;
|
|
256
|
+
export declare const StreamLogsSchema: z.ZodObject<{
|
|
257
|
+
container_id: z.ZodString;
|
|
258
|
+
tail: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
since: z.ZodOptional<z.ZodString>;
|
|
260
|
+
follow: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
container_id: string;
|
|
263
|
+
tail?: number | undefined;
|
|
264
|
+
follow?: boolean | undefined;
|
|
265
|
+
since?: string | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
container_id: string;
|
|
268
|
+
tail?: number | undefined;
|
|
269
|
+
follow?: boolean | undefined;
|
|
270
|
+
since?: string | undefined;
|
|
271
|
+
}>;
|
|
272
|
+
export declare const ContainerStatsSchema: z.ZodObject<{
|
|
273
|
+
container_id: z.ZodString;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
container_id: string;
|
|
276
|
+
}, {
|
|
277
|
+
container_id: string;
|
|
278
|
+
}>;
|
|
279
|
+
export declare const ExecInContainerSchema: z.ZodObject<{
|
|
280
|
+
container_id: z.ZodString;
|
|
281
|
+
command: z.ZodArray<z.ZodString, "many">;
|
|
282
|
+
working_dir: z.ZodOptional<z.ZodString>;
|
|
283
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
container_id: string;
|
|
286
|
+
command: string[];
|
|
287
|
+
env?: Record<string, string> | undefined;
|
|
288
|
+
working_dir?: string | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
container_id: string;
|
|
291
|
+
command: string[];
|
|
292
|
+
env?: Record<string, string> | undefined;
|
|
293
|
+
working_dir?: string | undefined;
|
|
294
|
+
}>;
|
|
295
|
+
export declare const ListNetworksSchema: z.ZodObject<{
|
|
296
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
filter?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
filter?: string | undefined;
|
|
301
|
+
}>;
|
|
302
|
+
export declare const ListVolumesSchema: z.ZodObject<{
|
|
303
|
+
filter: z.ZodOptional<z.ZodString>;
|
|
304
|
+
}, "strip", z.ZodTypeAny, {
|
|
305
|
+
filter?: string | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
filter?: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
//# sourceMappingURL=types.d.ts.map
|