Commit cdd5a15
authored
feat: add custom dockerfile support for Container agent builds (#783)
* feat: add custom dockerfile support for Container agent builds
Add an optional `dockerfile` field to Container agent configuration,
allowing users to specify a custom Dockerfile name (e.g. Dockerfile.gpu)
instead of the default "Dockerfile".
Changes across all layers:
- Schema: Add dockerfile field to AgentEnvSpecSchema with filename validation
- CLI wizard: Add "Custom Dockerfile" option to Advanced settings multi-select,
with dedicated Dockerfile input step in the breadcrumb wizard
- Dev server: Thread dockerfile through container config to docker build
- Deploy preflight: Validate custom dockerfile exists before deploy
- Packaging: Pass dockerfile to container build commands
- Security: getDockerfilePath rejects path traversal (/, \, ..)
- Tests: 64 new/updated tests across schema, preflight, dev config,
packaging, wizard, and constants
Constraint: Dockerfile must be a filename only (no path separators)
Rejected: Accept full paths | path traversal security risk
Rejected: Auto-copy Dockerfile on create | users manage their own Dockerfiles
Confidence: high
Scope-risk: moderate
Not-tested: Interactive TUI tested manually via TUI harness (not in CI)
* chore: remove dead code and redundant tests from dockerfile PR
- Remove unused ADVANCED_GROUP_LABELS constant (dead code)
- Remove unnecessary export on DOCKERFILE_NAME_REGEX
- Fix stale `steps` dependency in useGenerateWizard setAdvanced callback
- Trim computeByoSteps.test.ts to dockerfile-only tests (remove 11 tests
for pre-existing behavior unchanged by this PR)
- Remove redundant "uses default Dockerfile" tests that duplicate existing
coverage in preflight, config, and container packager test files
- Consolidate shell metacharacter it.each from 5 cases to 1 representative
Confidence: high
Scope-risk: narrow
* fix: skip template Dockerfile scaffolding when custom dockerfile is set
When a custom dockerfile is configured (e.g. Dockerfile.gpu), the
renderer was still copying the default template Dockerfile into the
agent directory, leaving an unused file alongside the custom one.
Thread the dockerfile config through AgentRenderConfig and use a new
exclude option on copyAndRenderDir to skip the template Dockerfile
when a custom one is specified. The .dockerignore is still scaffolded.
Constraint: copyAndRenderDir is a shared utility used by all renderers
Rejected: Delete template after render | user requested option A (don't create)
Confidence: high
Scope-risk: narrow
* fix: use PathInput file picker for Dockerfile selection in TUI
Replace the TextInput with PathInput for Dockerfile selection in both
the BYO add-agent and Generate wizard flows. This gives users a real
file browser with directory navigation and existence validation on
submit, matching the UX pattern used by the policy file picker.
BYO flow: PathInput scoped to the agent's code directory so users
browse their existing files and pick a Dockerfile.
Generate flow: PathInput scoped to cwd so users browse the filesystem
to find a Dockerfile to copy into the new project.
Added allowEmpty and emptyHelpText props to PathInput so users can
press Enter to use the default Dockerfile.
Constraint: PathInput is a shared component used by policy and import screens
Rejected: Soft warning on TextInput | user preferred real file picker like policy
Confidence: high
Scope-risk: narrow1 parent e266576 commit cdd5a15
26 files changed
Lines changed: 939 additions & 175 deletions
File tree
- src
- cli
- operations
- agent/generate
- deploy
- __tests__
- dev
- __tests__
- templates
- tui
- components
- screens
- agent
- __tests__
- create
- generate
- __tests__
- lib
- __tests__
- packaging
- __tests__
- schema
- llm-compacted
- schemas
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| 280 | + | |
279 | 281 | | |
280 | 282 | | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
| |||
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
99 | 127 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
370 | 399 | | |
371 | 400 | | |
372 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
56 | 60 | | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
133 | 137 | | |
134 | 138 | | |
135 | 139 | | |
| 140 | + | |
| 141 | + | |
136 | 142 | | |
137 | 143 | | |
138 | 144 | | |
| |||
207 | 213 | | |
208 | 214 | | |
209 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| |||
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
325 | | - | |
| 335 | + | |
326 | 336 | | |
| 337 | + | |
327 | 338 | | |
328 | 339 | | |
329 | 340 | | |
| |||
0 commit comments