From 53d3b5524a1574df0f78c4255acc8e5aad34a892 Mon Sep 17 00:00:00 2001 From: Ryosuke Hanatsuka Date: Sat, 20 Feb 2021 15:31:14 +0900 Subject: [PATCH] Update README.md for libcontainer Signed-off-by: Ryosuke Hanatsuka --- libcontainer/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcontainer/README.md b/libcontainer/README.md index 8b25d5c1c01..870e533dcdb 100644 --- a/libcontainer/README.md +++ b/libcontainer/README.md @@ -57,6 +57,10 @@ struct describing how the container is to be created. A sample would look simila ```go defaultMountFlags := unix.MS_NOEXEC | unix.MS_NOSUID | unix.MS_NODEV +var devices []*configs.DeviceRule +for _, device := range specconv.AllowedDevices { + devices = append(devices, &device.Rule) +} config := &configs.Config{ Rootfs: "/your/path/to/rootfs", Capabilities: &configs.Capabilities{ @@ -155,7 +159,7 @@ config := &configs.Config{ Parent: "system", Resources: &configs.Resources{ MemorySwappiness: nil, - Devices: specconv.AllowedDevices, + Devices: devices, }, }, MaskPaths: []string{