| 116 | description = 'Build a Docker image from a Dockerfile. Destructive (writes an image). For very long builds, consider background_job_start instead so it does not block.'; |
| 117 | isReadOnly = false; isDestructive = true; argsSchema = BuildArgs; |
| 118 | async execute(a: z.infer<typeof BuildArgs>): Promise<ToolResult> { |
| 119 | const args = ['build']; |
| 120 | if (a.tag) args.push('-t', a.tag); |
| 121 | if (a.dockerfile) args.push('-f', a.dockerfile); |
| 122 | args.push(a.context ?? '.'); |
| 123 | return docker(args, (a.timeout_seconds ?? 600) * 1000); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | // ---- docker_compose ---- |