2015-10-02 22:43:16 +08:00
# Filesystem Bundle
2015-09-11 02:36:13 +08:00
## Container Format
2015-06-25 08:15:48 +08:00
2015-10-02 22:43:16 +08:00
This section defines a format for encoding a container as a *filesystem bundle* - a set of files organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it.
2015-09-09 22:17:06 +08:00
See also [OS X application bundles ](http://en.wikipedia.org/wiki/Bundle_%28OS_X%29 ) for a similar use of the term *bundle* .
2015-06-25 08:15:48 +08:00
2015-10-02 22:43:16 +08:00
The definition of a bundle is only concerned with how a container, and its configuration data, are stored on a local file system so that it can be consumed by a compliant runtime.
2015-06-25 08:15:48 +08:00
2015-10-02 22:43:16 +08:00
A Standard Container bundle contains all the information needed to load and run a container.
This includes the following three artifacts which MUST all reside in the same directory on the local filesystem:
2015-06-25 08:15:48 +08:00
2015-12-04 14:39:34 +08:00
1. `config.json` : contains host-independent configuration data.
This REQUIRED file, which MUST be named `config.json` , contains settings that are host-independent and application-specific such as security permissions, environment variables and arguments.
2015-10-30 22:32:56 +08:00
When the bundle is packaged up for distribution, this file MUST be included.
2015-10-02 22:43:16 +08:00
See [`config.json` ](config.md ) for more details.
2015-06-25 08:15:48 +08:00
2015-10-30 22:32:56 +08:00
2. `runtime.json` : contains host-specific configuration data.
2015-12-04 14:39:34 +08:00
This REQUIRED file, which MUST be named `runtime.json` , contains settings that are host-specific such as mount sources and hooks.
2015-10-30 22:32:56 +08:00
The goal is that the bundle can be moved as a unit to another runtime and run the same application once a host-specific `runtime.json` is defined.
When the bundle is packaged up for distribution, this file MUST NOT be included.
2015-10-02 22:43:16 +08:00
See [`runtime.json` ](runtime-config.md ) for more details.
2015-06-25 08:15:48 +08:00
2015-10-02 22:43:16 +08:00
3. A directory representing the root filesystem of the container.
While the name of this REQUIRED directory may be arbitrary, users should consider using a conventional name, such as `rootfs` .
2015-10-30 22:32:56 +08:00
When the bundle is packaged up for distribution, this directory MUST be included.
2015-10-02 22:43:16 +08:00
This directory MUST be referenced from within the `config.json` file.
2015-06-25 08:15:48 +08:00
2016-01-05 15:02:30 +08:00
While these three artifacts MUST all be present in a single directory on the local filesystem, that directory itself is not part of the bundle.
2015-10-02 22:43:16 +08:00
In other words, a tar archive of a *bundle* will have these artifacts at the root of the archive, not nested within a top-level directory.