Skip to content

Commit

Permalink
Cleanup bundle.md
Browse files Browse the repository at this point in the history
Mainly just moved stuff around, but also tried to add some clarity around
what is required w.r.t. naming and location of files/dirs.

Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
Doug Davis committed Oct 2, 2015
1 parent 294b77c commit 1abc017
Showing 1 changed file with 43 additions and 36 deletions.
79 changes: 43 additions & 36 deletions bundle.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
# Bundle
# Filesystem Bundle

## Container Format

This section defines a format for encoding a container as a *bundle* - a directory organized in a certain way, and containing all the necessary data and metadata for any compliant runtime to perform all standard operations against it.
See also [OS X application bundles](http://en.wikipedia.org/wiki/Bundle_%28OS_X%29) for a similar use of the term *bundle*.

The format does not define distribution.
In other words, it only specifies how a container must be stored on a local filesystem, for consumption by a runtime.
It does not specify how to transfer a container between computers, how to discover containers, or assign names or versions to them.
Any distribution method capable of preserving the original layout of a container, as specified here, is considered compliant.

A standard container bundle is made of the following 3 parts:

- A top-level directory holding everything else
- One or more content directories
- A configuration file

## Directory layout

A Standard Container bundle is a directory containing all the content needed to load and run a container.
This includes two configuration files `config.json` and `runtime.json`, and a rootfs directory.
The `config.json` file contains settings that are host independent and application specific such as security permissions, environment variables and arguments.
The `runtime.json` file contains settings that are host specific such as memory limits, local device access and mount points.
The goal is that the bundle can be moved as a unit to another machine and run the same application if `runtime.json` is removed or reconfigured.

Configuration file syntax and semantics:

* [`config.json`](config.md) (immutable, host independent configuration)
* [`runtime.json`](runtime-config.md) (mutable, host dependent configuration)

A single `rootfs` directory MUST be in the same directory as the `config.json`.
The names of the directories may be arbitrary, but users should consider using conventional names as in the example below.

```
config.json
runtime.json
rootfs/
```
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. See also
[OS X application bundles](http://en.wikipedia.org/wiki/Bundle_%28OS_X%29)
for a similar use of the term *bundle*.

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.
Issues such as distribution, including how to transfer a container
between runtimes, assigning names, versioning of bundle, or discovery of
bundles are out of scope of this specification.

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:

1. `config.json` : immutable, host independent configuration.
This file, which MUST be named `config.json`, contains
settings that are host independent and application specific such as security
permissions, environment variables and arguments. See
[`config.json`](config.md) for more details.

2. `runtime.json` : mutable, host dependent configuration.
This file, which MUST be named `runtime.json`, contains
settings that are host specific such as memory limits, local device access
and mount points.
The goal is that the bundle can be moved as a unit to another runtime and
run the same application if `runtime.json` is reconfigured.
See [`runtime.json`](runtime-config.md) for more details.

3. A directory representing the root filesystem of the container.
While the name of this directory may be arbitrary, users should consider using
a conventional name, such as `rootfs`. This directory will be referenced from
within the `config.json` file.

While these three artifacts MUST all be present in a single directory on the
local filesytem, that directory itself is not part of the bundle. 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.

0 comments on commit 1abc017

Please sign in to comment.