forked from devcontainers/spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevcontainer-feature.schema.json
More file actions
280 lines (280 loc) · 11.4 KB
/
devcontainer-feature.schema.json
File metadata and controls
280 lines (280 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Development Container Feature Metadata",
"description": "Development Container Features Metadata (devcontainer-feature.json). See https://containers.dev/implementors/features/ for more information.",
"definitions": {
"Feature": {
"additionalProperties": false,
"properties": {
"capAdd": {
"description": "Passes docker capabilities to include when creating the dev container.",
"examples": ["SYS_PTRACE"],
"items": {
"type": "string"
},
"type": "array"
},
"containerEnv": {
"description": "Container environment variables.",
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"customizations": {
"description": "Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations.",
"additionalProperties": true,
"type": "object"
},
"description": {
"description": "Description of the Feature. For the best appearance in an implementing tool, refrain from including markdown or HTML in the description.",
"type": "string"
},
"documentationURL": {
"description": "URL to documentation for the Feature.",
"type": "string"
},
"entrypoint": {
"description": "Entrypoint script that should fire at container start up.",
"type": "string"
},
"id": {
"description": "ID of the Feature. The id should be unique in the context of the repository/published package where the feature exists and must match the name of the directory where the devcontainer-feature.json resides.",
"type": "string"
},
"init": {
"description": "Adds the tiny init process to the container (--init) when the Feature is used.",
"type": "boolean"
},
"installsAfter": {
"description": "Array of ID's of Features that should execute before this one. Allows control for feature authors on soft dependencies between different Features.",
"items": {
"type": "string"
},
"type": "array"
},
"licenseURL": {
"description": "URL to the license for the Feature.",
"type": "string"
},
"mounts": {
"description": "Mounts a volume or bind mount into the container.",
"items": {
"$ref": "#/definitions/Mount"
},
"type": "array"
},
"name": {
"description": "Display name of the Feature.",
"type": "string"
},
"options": {
"description": "Possible user-configurable options for this Feature. The selected options will be passed as environment variables when installing the Feature into the container.",
"additionalProperties": {
"$ref": "#/definitions/FeatureOption"
},
"type": "object"
},
"privileged": {
"description": "Sets privileged mode (--privileged) for the container.",
"type": "boolean"
},
"securityOpt": {
"description": "Sets container security options to include when creating the container.",
"items": {
"type": "string"
},
"type": "array"
},
"version": {
"description": "The version of the Feature. Follows the semanatic versioning (semver) specification.",
"type": "string"
},
"legacyIds": {
"description": "Array of old IDs used to publish this Feature. The property is useful for renaming a currently published Feature within a single namespace.",
"items": {
"type": "string"
},
"type": "array"
},
"deprecated": {
"description": "Indicates that the Feature is deprecated, and will not receive any further updates/support. This property is intended to be used by the supporting tools for highlighting Feature deprecation.",
"type": "boolean"
},
"onCreateCommand": {
"type": ["string", "array", "object"],
"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. If this is an object, each provided command will be run in parallel.",
"items": {
"type": "string"
},
"additionalProperties": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
},
"updateContentCommand": {
"type": ["string", "array", "object"],
"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. If this is an object, each provided command will be run in parallel.",
"items": {
"type": "string"
},
"additionalProperties": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
},
"postCreateCommand": {
"type": ["string", "array", "object"],
"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. If this is an object, each provided command will be run in parallel.",
"items": {
"type": "string"
},
"additionalProperties": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
},
"postStartCommand": {
"type": ["string", "array", "object"],
"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. If this is an object, each provided command will be run in parallel.",
"items": {
"type": "string"
},
"additionalProperties": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
},
"postAttachCommand": {
"type": ["string", "array", "object"],
"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. If this is an object, each provided command will be run in parallel.",
"items": {
"type": "string"
},
"additionalProperties": {
"type": ["string", "array"],
"items": {
"type": "string"
}
}
}
},
"required": ["id", "version"],
"type": "object"
},
"FeatureOption": {
"anyOf": [
{
"description": "Option value is represented with a boolean value.",
"additionalProperties": false,
"properties": {
"default": {
"description": "Default value if the user omits this option from their configuration.",
"type": "boolean"
},
"description": {
"description": "A description of the option displayed to the user by a supporting tool.",
"type": "string"
},
"type": {
"description": "The type of the option. Can be 'boolean' or 'string'. Options of type 'string' should use the 'enum' or 'proposals' property to provide a list of allowed values.",
"const": "boolean",
"type": "string"
}
},
"required": ["type", "default"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"default": {
"description": "Default value if the user omits this option from their configuration.",
"type": "string"
},
"description": {
"description": "A description of the option displayed to the user by a supporting tool.",
"type": "string"
},
"enum": {
"description": "Allowed values for this option. Unlike 'proposals', the user cannot provide a custom value not included in the 'enum' array.",
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"description": "The type of the option. Can be 'boolean' or 'string'. Options of type 'string' should use the 'enum' or 'proposals' property to provide a list of allowed values.",
"const": "string",
"type": "string"
}
},
"required": ["type", "enum", "default"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"default": {
"description": "Default value if the user omits this option from their configuration.",
"type": "string"
},
"description": {
"description": "A description of the option displayed to the user by a supporting tool.",
"type": "string"
},
"proposals": {
"description": "Suggested values for this option. Unlike 'enum', the 'proposals' attribute indicates the installation script can handle arbitrary values provided by the user.",
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"description": "The type of the option. Can be 'boolean' or 'string'. Options of type 'string' should use the 'enum' or 'proposals' property to provide a list of allowed values.",
"const": "string",
"type": "string"
}
},
"required": ["type", "default"],
"type": "object"
}
]
},
"Mount": {
"description": "Mounts a volume or bind mount into the container.",
"additionalProperties": false,
"properties": {
"source": {
"description": "Mount source.",
"type": "string"
},
"target": {
"description": "Mount target.",
"type": "string"
},
"type": {
"description": "Type of mount. Can be 'bind' or 'volume'.",
"enum": ["bind", "volume"],
"type": "string"
}
},
"required": ["type", "source", "target"],
"type": "object"
}
},
"oneOf": [
{
"type": "object",
"$ref": "#/definitions/Feature"
}
]
}