@@ -76,14 +76,18 @@ PID USER COMMAND
7676
7777### OCI Container JSON Format:
7878
79- Below are sample ` config.json ` and ` runtime.json ` configuration files. It assumes that
80- the file-system is found in a directory called ` rootfs ` and there is a
81- user with uid and gid of ` 0 ` defined within that file-system.
79+ OCI container JSON format is based on OCI [ specs] ( https://github.com/opencontainers/specs ) .
80+ You can generate JSON files by using ` runc spec ` , it'll generate ` config.json `
81+ and ` runtime.json ` . It assumes that the file-system is found in a directory called
82+ ` rootfs ` and there is a user with uid and gid of ` 0 ` defined within that file-system.
83+
84+ Below are sample ` config.json ` and ` runtime.json ` configuration files. Note that it
85+ could be outdated, please always create base JSON files by ` runc spec ` .
8286
8387` config.json ` :
8488``` json
8589{
86- "version" : " 0.1 .0" ,
90+ "version" : " 0.2 .0" ,
8791 "platform" : {
8892 "os" : " linux" ,
8993 "arch" : " amd64"
@@ -153,10 +157,16 @@ user with uid and gid of `0` defined within that file-system.
153157``` json
154158{
155159 "mounts" : {
156- "proc" : {
157- "type" : " proc" ,
158- "source" : " proc" ,
159- "options" : null
160+ "cgroup" : {
161+ "type" : " cgroup" ,
162+ "source" : " cgroup" ,
163+ "options" : [
164+ " nosuid" ,
165+ " noexec" ,
166+ " nodev" ,
167+ " relatime" ,
168+ " ro"
169+ ]
160170 },
161171 "dev" : {
162172 "type" : " tmpfs" ,
@@ -180,6 +190,20 @@ user with uid and gid of `0` defined within that file-system.
180190 " gid=5"
181191 ]
182192 },
193+ "mqueue" : {
194+ "type" : " mqueue" ,
195+ "source" : " mqueue" ,
196+ "options" : [
197+ " nosuid" ,
198+ " noexec" ,
199+ " nodev"
200+ ]
201+ },
202+ "proc" : {
203+ "type" : " proc" ,
204+ "source" : " proc" ,
205+ "options" : null
206+ },
183207 "shm" : {
184208 "type" : " tmpfs" ,
185209 "source" : " shm" ,
@@ -191,15 +215,6 @@ user with uid and gid of `0` defined within that file-system.
191215 " size=65536k"
192216 ]
193217 },
194- "mqueue" : {
195- "type" : " mqueue" ,
196- "source" : " mqueue" ,
197- "options" : [
198- " nosuid" ,
199- " noexec" ,
200- " nodev"
201- ]
202- },
203218 "sysfs" : {
204219 "type" : " sysfs" ,
205220 "source" : " sysfs" ,
@@ -208,21 +223,11 @@ user with uid and gid of `0` defined within that file-system.
208223 " noexec" ,
209224 " nodev"
210225 ]
211- },
212- "cgroup" : {
213- "type" : " cgroup" ,
214- "source" : " cgroup" ,
215- "options" : [
216- " nosuid" ,
217- " noexec" ,
218- " nodev" ,
219- " relatime" ,
220- " ro"
221- ]
222226 }
223227 },
224228 "hooks" : {
225229 "prestart" : null ,
230+ "poststart" : null ,
226231 "poststop" : null
227232 },
228233 "linux" : {
@@ -259,11 +264,12 @@ user with uid and gid of `0` defined within that file-system.
259264 },
260265 "blockIO" : {
261266 "blkioWeight" : 0 ,
262- "blkioWeightDevice" : " " ,
263- "blkioThrottleReadBpsDevice" : " " ,
264- "blkioThrottleWriteBpsDevice" : " " ,
265- "blkioThrottleReadIopsDevice" : " " ,
266- "blkioThrottleWriteIopsDevice" : " "
267+ "blkioLeafWeight" : 0 ,
268+ "blkioWeightDevice" : null ,
269+ "blkioThrottleReadBpsDevice" : null ,
270+ "blkioThrottleWriteBpsDevice" : null ,
271+ "blkioThrottleReadIOPSDevice" : null ,
272+ "blkioThrottleWriteIOPSDevice" : null
267273 },
268274 "hugepageLimits" : null ,
269275 "network" : {
@@ -360,6 +366,7 @@ user with uid and gid of `0` defined within that file-system.
360366 "selinuxProcessLabel" : " " ,
361367 "seccomp" : {
362368 "defaultAction" : " SCMP_ACT_ALLOW" ,
369+ "architectures" : null ,
363370 "syscalls" : []
364371 },
365372 "rootfsPropagation" : " "
@@ -380,8 +387,7 @@ To test using Docker's `busybox` image follow these steps:
380387mkdir rootfs
381388tar -C rootfs -xf busybox.tar
382389```
383- * Create ` config.json ` and ` runtime.json ` using the example from above. You can also
384- generate a spec using ` runc spec ` , which will create those files for you.
390+ * Create ` config.json ` and ` runtime.json ` by using ` runc spec ` .
385391* Execute ` runc start ` and you should be placed into a shell where you can run ` ps ` :
386392```
387393$ runc start
0 commit comments