Skip to content

Commit 7bf06d5

Browse files
committed
source and schema: differentiate with examples
The standard is on the JSON schema (not yet IETF spec JSON-schema), such that it is not implemenations specific. Thus far, the reference has been in how golang source renders the JSON documents. Having the JSON source and the markdown documents in sync has been an ongoing step to keep in sync. Separating these two allows the golang source to continue being _a_ reference, but the JSON schema in the documentation to be _the_ reference. As validation tooling is refined, then it will facilitate ensuring the available golang source conforms to the reference JSON. Signed-off-by: Vincent Batts <[email protected]>
1 parent dae09c6 commit 7bf06d5

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed

config.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,160 @@ Annotations are key-value maps.
244244
}
245245
```
246246

247+
## Configuration Schema Example
248+
249+
Here is a full example `config.json` for reference.
250+
251+
```json
252+
{
253+
"ociVersion": "0.3.0",
254+
"platform": {
255+
"os": "linux",
256+
"arch": "amd64"
257+
},
258+
"process": {
259+
"terminal": true,
260+
"user": {
261+
"uid": 1,
262+
"gid": 1,
263+
"additionalGids": [5, 6]
264+
},
265+
"args": [
266+
"sh"
267+
],
268+
"env": [
269+
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
270+
"TERM=xterm"
271+
],
272+
"cwd": "/",
273+
"capabilities": [
274+
"CAP_AUDIT_WRITE",
275+
"CAP_KILL",
276+
"CAP_NET_BIND_SERVICE"
277+
],
278+
"apparmorProfile": "",
279+
"selinuxLabel": ""
280+
},
281+
"root": {
282+
"path": "rootfs",
283+
"readonly": true
284+
},
285+
"hostname": "slartibartfast",
286+
"mounts": [
287+
{
288+
"destination": "/proc",
289+
"type": "proc",
290+
"source": "proc"
291+
},
292+
{
293+
"destination": "/dev",
294+
"type": "tmpfs",
295+
"source": "tmpfs",
296+
"options": [
297+
"nosuid",
298+
"strictatime",
299+
"mode=755",
300+
"size=65536k"
301+
]
302+
},
303+
{
304+
"destination": "/dev/pts",
305+
"type": "devpts",
306+
"source": "devpts",
307+
"options": [
308+
"nosuid",
309+
"noexec",
310+
"newinstance",
311+
"ptmxmode=0666",
312+
"mode=0620",
313+
"gid=5"
314+
]
315+
},
316+
{
317+
"destination": "/dev/shm",
318+
"type": "tmpfs",
319+
"source": "shm",
320+
"options": [
321+
"nosuid",
322+
"noexec",
323+
"nodev",
324+
"mode=1777",
325+
"size=65536k"
326+
]
327+
},
328+
{
329+
"destination": "/dev/mqueue",
330+
"type": "mqueue",
331+
"source": "mqueue",
332+
"options": [
333+
"nosuid",
334+
"noexec",
335+
"nodev"
336+
]
337+
},
338+
{
339+
"destination": "/sys",
340+
"type": "sysfs",
341+
"source": "sysfs",
342+
"options": [
343+
"nosuid",
344+
"noexec",
345+
"nodev"
346+
]
347+
},
348+
{
349+
"destination": "/sys/fs/cgroup",
350+
"type": "cgroup",
351+
"source": "cgroup",
352+
"options": [
353+
"nosuid",
354+
"noexec",
355+
"nodev",
356+
"relatime",
357+
"ro"
358+
]
359+
}
360+
],
361+
"hooks": {
362+
"prestart": [
363+
{
364+
"path": "/",
365+
"args": ["/usr/bin/uptime"],
366+
"env": []
367+
}
368+
]
369+
},
370+
"linux": {
371+
"rlimits": [
372+
{
373+
"type": "RLIMIT_NOFILE",
374+
"hard": 1024,
375+
"soft": 1024
376+
}
377+
],
378+
"resources": {
379+
"devices": [
380+
{
381+
"allow": false,
382+
"access": "rwm"
383+
}
384+
]
385+
},
386+
"namespaces": [
387+
{ "type": "pid" },
388+
{ "type": "network" },
389+
{ "type": "ipc" },
390+
{ "type": "uts" },
391+
{ "type": "mount" }
392+
],
393+
"devices": null,
394+
"seccomp": {
395+
"defaultAction": "",
396+
"architectures": null
397+
}
398+
}
399+
}
400+
```
401+
402+
247403
[uts-namespace]: http://man7.org/linux/man-pages/man7/namespaces.7.html
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)