Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,24 @@ Each container has exactly one *root filesystem*, specified in the *root* object

You MAY add array of mount points inside container as `mounts`.
The runtime MUST mount entries in the listed order.
The parameters are similar to the ones in [the Linux mount system call](http://man7.org/linux/man-pages/man2/mount.2.html).
The parameters are similar to the ones in [the Linux mount system call][mount.2].

* **`destination`** (string, required) Destination of mount point: path inside container.
For the Windows operating system, one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
* **`type`** (string, required) The filesystem type of the filesystem to be mounted.
Linux: *filesystemtype* argument supported by the kernel are listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
* **`type`** (string, optional) The type of filesystem to mount.
If `type` is unset, the runtime MAY ask the kernel to guess the desired type.
Depending on the mount `options`, the `type` field MAY be ignored.
For example, `type` is ignored when `options` contains `bind`; see the `MS_BIND` description in [mount(2)][mount.2].
Linux: [*filesystemtype*][mount.2] values supported by the kernel are listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
Windows: ntfs.
* **`source`** (string, required) A device name, but can also be a directory name or a dummy.
Windows: the volume name that is the target of the mount point, \\?\Volume\{GUID}\ (on Windows source is called target).
* **`options`** (list of strings, optional) Mount options of the filesystem to be used.
Linux: [supported][mount.8-filesystem-independent] [options][mount.8-filesystem-specific] are listed in [mount(8)][mount.8].
Linux runtimes MUST also support the following options:

* `recursive`, with the semantics of [`MS_REC`][mount.2].
* `bind`, with the semantics of [`MS_BIND`][mount.2].

### Example (Linux)

Expand All @@ -65,9 +72,8 @@ The parameters are similar to the ones in [the Linux mount system call](http://m
},
{
"destination": "/data",
"type": "bind",
"source": "/volumes/testing",
"options": ["rbind","rw"]
"options": ["recursive", "bind", "rw"]
}
]
```
Expand Down Expand Up @@ -688,6 +694,8 @@ Here is a full example `config.json` for reference.
[go-environment]: https://golang.org/doc/install/source#environment
[runtime-namespace]: glossary.md#runtime-namespace
[uts-namespace]: http://man7.org/linux/man-pages/man7/namespaces.7.html
[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html
[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT OPTIONS
[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT OPTIONS
[mount.8-options]: http://man7.org/linux/man-pages/man8/mount.8.html#COMMAND-LINE_OPTIONS
[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html
3 changes: 1 addition & 2 deletions schema/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@
},
"required": [
"destination",
"source",
"type"
"source"
]
},
"ociVersion": {
Expand Down
4 changes: 2 additions & 2 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ type Platform struct {
type Mount struct {
// Destination is the path where the mount will be placed relative to the container's root. The path and child directories MUST exist, a runtime MUST NOT create directories automatically to a mount point.
Destination string `json:"destination"`
// Type specifies the mount kind.
Type string `json:"type"`
// Type specifies the type of filesystem to mount.
Type string `json:"type,omitempty"`
// Source specifies the source path of the mount. In the case of bind mounts on
// Linux based systems this would be the file on the host.
Source string `json:"source"`
Expand Down