Skip to content

Commit 603e077

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 <vbatts@hashbangbash.com>
1 parent 3b7c15d commit 603e077

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
@@ -231,4 +231,160 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
231231
`args` and `env` are optional.
232232
The semantics are the same as `Path`, `Args` and `Env` in [golang Cmd](https://golang.org/pkg/os/exec/#Cmd).
233233

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

0 commit comments

Comments
 (0)