Skip to content

Commit 793ae79

Browse files
authored
Update docs for lifecycle command changes (devcontainers#84)
* Update docs for lifecycle command changes * Fix up the object types * Fix up formatting
1 parent dfc1475 commit 793ae79

File tree

2 files changed

+60
-10
lines changed

2 files changed

+60
-10
lines changed

_implementors/json_schema.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,51 +206,101 @@ You may review the current devcontainer.json schemas in the spec repo, which inc
206206
"onCreateCommand": {
207207
"type": [
208208
"string",
209-
"array"
209+
"array",
210+
"object"
210211
],
211212
"description": "A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
212213
"items": {
213214
"type": "string"
215+
},
216+
"additionalProperties": {
217+
"type": [
218+
"string",
219+
"array"
220+
],
221+
"items": {
222+
"type": "string"
223+
}
214224
}
215225
},
216226
"updateContentCommand": {
217227
"type": [
218228
"string",
219-
"array"
229+
"array",
230+
"object"
220231
],
221232
"description": "A command to run when creating the container and rerun when the workspace content was updated while creating the container. This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
222233
"items": {
223234
"type": "string"
235+
},
236+
"additionalProperties": {
237+
"type": [
238+
"string",
239+
"array"
240+
],
241+
"items": {
242+
"type": "string"
243+
}
224244
}
225245
},
226246
"postCreateCommand": {
227247
"type": [
228248
"string",
229-
"array"
249+
"array",
250+
"object"
230251
],
231252
"description": "A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
232253
"items": {
233254
"type": "string"
255+
},
256+
"additionalProperties": {
257+
"type": [
258+
"string",
259+
"array"
260+
],
261+
"items": {
262+
"type": "string"
263+
}
234264
}
235265
},
236266
"postStartCommand": {
237267
"type": [
238268
"string",
239-
"array"
269+
"array",
270+
"object"
240271
],
241272
"description": "A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
242273
"items": {
243274
"type": "string"
275+
},
276+
"additionalProperties": {
277+
"type": [
278+
"string",
279+
"array"
280+
],
281+
"items": {
282+
"type": "string"
283+
}
244284
}
245285
},
246286
"postAttachCommand": {
247287
"type": [
248288
"string",
249-
"array"
289+
"array",
290+
"object"
250291
],
251292
"description": "A command to run when attaching to the container. This command is run after \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
252293
"items": {
253294
"type": "string"
295+
},
296+
"additionalProperties": {
297+
"type": [
298+
"string",
299+
"array"
300+
],
301+
"items": {
302+
"type": "string"
303+
}
254304
}
255305
},
256306
"waitFor": {

_implementors/spec.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ To apply the metadata together with a user's devcontainer.json at runtime the fo
7373
| `securityOpt` | `string[]` | Union of all `securityOpt` arrays without duplicates. | x | x |
7474
| `entrypoint` | `string` | Collected list of all entrypoints. | | x |
7575
| `mounts` | `(string \| { type, src, dst })[]` | Collected list of all mountpoints. Conflicts: Last source wins. | x | x |
76-
| `onCreateCommand` | `string \| string[]` | Collected list of all onCreateCommands. | x | |
77-
| `updateContentCommand` | `string \| string[]` | Collected list of all updateContentCommands. | x | |
78-
| `postCreateCommand` | `string \| string[]` | Collected list of all postCreateCommands. | x | |
79-
| `postStartCommand` | `string \| string[]` | Collected list of all postStartCommands. | x | |
80-
| `postAttachCommand` | `string \| string[]` | Collected list of all postAttachCommands. | x | |
76+
| `onCreateCommand` | `string \| string[] \| {[key: string]: string \| string[]}` | Collected list of all onCreateCommands. | x | |
77+
| `updateContentCommand` | `string \| string[] \| {[key: string]: string \| string[]}` | Collected list of all updateContentCommands. | x | |
78+
| `postCreateCommand` | `string \| string[] \| {[key: string]: string \| string[]}` | Collected list of all postCreateCommands. | x | |
79+
| `postStartCommand` | `string \| string[] \| {[key: string]: string \| string[]}` | Collected list of all postStartCommands. | x | |
80+
| `postAttachCommand` | `string \| string[] \| {[key: string]: string \| string[]}` | Collected list of all postAttachCommands. | x | |
8181
| `waitFor` | enum | Last value wins. | x | |
8282
| `customizations` | Object of tool-specific customizations. | Merging is left to the tools. | x | x |
8383
| `containerUser` | `string` | Last value wins. | x | |

0 commit comments

Comments
 (0)