@@ -8,11 +8,13 @@ It allows you to manage the lifecycle of the container performing additional ope
88after the container is created.
99
1010
11- #### Container
11+ ## Container
1212A container is a self contained execution environment that shares the kernel of the
1313host system and which is (optionally) isolated from other containers in the system.
1414
15- #### Using libcontainer
15+ ## Using libcontainer
16+
17+ ### Container init
1618
1719Because containers are spawned in a two step process you will need a binary that
1820will be executed as the init process for the container. In libcontainer, we use
@@ -27,7 +29,24 @@ For details on how runc implements such "init", see
2729[ init.go] ( https://github.com/opencontainers/runc/blob/master/init.go )
2830and [ libcontainer/init_linux.go] ( https://github.com/opencontainers/runc/blob/master/libcontainer/init_linux.go ) .
2931
30- Then to create a container you first have to create a configuration
32+ ### Device management
33+
34+ If you want containers that have access to some devices, you need to import
35+ this package into your code:
36+
37+ ``` go
38+ import (
39+ _ " github.com/opencontainers/runc/libcontainer/cgroups/devices"
40+ )
41+ ```
42+
43+ Without doing this, libcontainer cgroup manager won't be able to set up device
44+ access rules, and will fail if devices are specified in the container
45+ configuration.
46+
47+ ### Container creation
48+
49+ To create a container you first have to create a configuration
3150struct describing how the container is to be created. A sample would look similar to this:
3251
3352``` go
@@ -274,7 +293,7 @@ state, err := container.State()
274293```
275294
276295
277- #### Checkpoint & Restore
296+ ## Checkpoint & Restore
278297
279298libcontainer now integrates [ CRIU] ( http://criu.org/ ) for checkpointing and restoring containers.
280299This lets you save the state of a process running inside a container to disk, and then restore
0 commit comments