Skip to content

Commit 6cc6798

Browse files
author
Mrunal Patel
committed
Merge pull request #162 from vbatts/formatting
*.md: markdown formatting
2 parents 26b9be2 + 6cab274 commit 6cc6798

File tree

6 files changed

+66
-37
lines changed

6 files changed

+66
-37
lines changed

README.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Open Container Specifications
22

3-
This project is where the [Open Container Initiative](http://www.opencontainers.org/) Specifications are written. This is a work in progress. We should have a first draft by end of July 2015.
3+
This project is where the [Open Container Initiative](http://www.opencontainers.org/) Specifications are written.
4+
This is a work in progress.
5+
We should have a first draft by end of July 2015.
46

57
Table of Contents
68

@@ -20,35 +22,53 @@ To provide context for users the following section gives example use cases for e
2022

2123
# The 5 principles of Standard Containers
2224

23-
Define a unit of software delivery called a Standard Container. The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container.
25+
Define a unit of software delivery called a Standard Container.
26+
The goal of a Standard Container is to encapsulate a software component and all its dependencies in a format that is self-describing and portable, so that any compliant runtime can run it without extra dependencies, regardless of the underlying machine and the contents of the container.
2427

25-
The specification for Standard Containers is straightforward. It mostly defines 1) a file format, 2) a set of standard operations, and 3) an execution environment.
28+
The specification for Standard Containers is straightforward.
29+
It mostly defines 1) a file format, 2) a set of standard operations, and 3) an execution environment.
2630

27-
A great analogy for this is the shipping container. Just like how Standard Containers are a fundamental unit of software delivery, shipping containers are a fundamental unit of physical delivery.
31+
A great analogy for this is the shipping container.
32+
Just like how Standard Containers are a fundamental unit of software delivery, shipping containers are a fundamental unit of physical delivery.
2833

2934
## 1. Standard operations
3035

31-
Just like shipping containers, Standard Containers define a set of STANDARD OPERATIONS. Shipping containers can be lifted, stacked, locked, loaded, unloaded and labelled. Similarly, Standard Containers can be created, started, and stopped using standard container tools (what this spec is about); copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools.
36+
Just like shipping containers, Standard Containers define a set of STANDARD OPERATIONS.
37+
Shipping containers can be lifted, stacked, locked, loaded, unloaded and labelled.
38+
Similarly, Standard Containers can be created, started, and stopped using standard container tools (what this spec is about); copied and snapshotted using standard filesystem tools; and downloaded and uploaded using standard network tools.
3239

3340
## 2. Content-agnostic
3441

35-
Just like shipping containers, Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents. A shipping container will be stacked in exactly the same way whether it contains Vietnamese powder coffee or spare Maserati parts. Similarly, Standard Containers are started or uploaded in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts.
42+
Just like shipping containers, Standard Containers are CONTENT-AGNOSTIC: all standard operations have the same effect regardless of the contents.
43+
A shipping container will be stacked in exactly the same way whether it contains Vietnamese powder coffee or spare Maserati parts.
44+
Similarly, Standard Containers are started or uploaded in the same way whether they contain a postgres database, a php application with its dependencies and application server, or Java build artifacts.
3645

3746
## 3. Infrastructure-agnostic
3847

39-
Both types of containers are INFRASTRUCTURE-AGNOSTIC: they can be transported to thousands of facilities around the world, and manipulated by a wide variety of equipment. A shipping container can be packed in a factory in Ukraine, transported by truck to the nearest routing center, stacked onto a train, loaded into a German boat by an Australian-built crane, stored in a warehouse at a US facility, etc. Similarly, a standard container can be bundled on my laptop, uploaded to S3, downloaded, run and snapshotted by a build server at Equinix in Virginia, uploaded to 10 staging servers in a home-made Openstack cluster, then sent to 30 production instances across 3 EC2 regions.
48+
Both types of containers are INFRASTRUCTURE-AGNOSTIC: they can be transported to thousands of facilities around the world, and manipulated by a wide variety of equipment.
49+
A shipping container can be packed in a factory in Ukraine, transported by truck to the nearest routing center, stacked onto a train, loaded into a German boat by an Australian-built crane, stored in a warehouse at a US facility, etc.
50+
Similarly, a standard container can be bundled on my laptop, uploaded to S3, downloaded, run and snapshotted by a build server at Equinix in Virginia, uploaded to 10 staging servers in a home-made Openstack cluster, then sent to 30 production instances across 3 EC2 regions.
4051

4152
## 4. Designed for automation
4253

43-
Because they offer the same standard operations regardless of content and infrastructure, Standard Containers, just like their physical counterparts, are extremely well-suited for automation. In fact, you could say automation is their secret weapon.
54+
Because they offer the same standard operations regardless of content and infrastructure, Standard Containers, just like their physical counterparts, are extremely well-suited for automation.
55+
In fact, you could say automation is their secret weapon.
4456

45-
Many things that once required time-consuming and error-prone human effort can now be programmed. Before shipping containers, a bag of powder coffee was hauled, dragged, dropped, rolled and stacked by 10 different people in 10 different locations by the time it reached its destination. 1 out of 50 disappeared. 1 out of 20 was damaged. The process was slow, inefficient and cost a fortune - and was entirely different depending on the facility and the type of goods.
57+
Many things that once required time-consuming and error-prone human effort can now be programmed.
58+
Before shipping containers, a bag of powder coffee was hauled, dragged, dropped, rolled and stacked by 10 different people in 10 different locations by the time it reached its destination.
59+
1 out of 50 disappeared.
60+
1 out of 20 was damaged.
61+
The process was slow, inefficient and cost a fortune - and was entirely different depending on the facility and the type of goods.
4662

47-
Similarly, before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers. Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken. The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider.
63+
Similarly, before Standard Containers, by the time a software component ran in production, it had been individually built, configured, bundled, documented, patched, vendored, templated, tweaked and instrumented by 10 different people on 10 different computers.
64+
Builds failed, libraries conflicted, mirrors crashed, post-it notes were lost, logs were misplaced, cluster updates were half-broken.
65+
The process was slow, inefficient and cost a fortune - and was entirely different depending on the language and infrastructure provider.
4866

4967
## 5. Industrial-grade delivery
5068

51-
There are 17 million shipping containers in existence, packed with every physical good imaginable. Every single one of them can be loaded onto the same boats, by the same cranes, in the same facilities, and sent anywhere in the World with incredible efficiency. It is embarrassing to think that a 30 ton shipment of coffee can safely travel half-way across the World in *less time* than it takes a software team to deliver its code from one datacenter to another sitting 10 miles away.
69+
There are 17 million shipping containers in existence, packed with every physical good imaginable.
70+
Every single one of them can be loaded onto the same boats, by the same cranes, in the same facilities, and sent anywhere in the World with incredible efficiency.
71+
It is embarrassing to think that a 30 ton shipment of coffee can safely travel half-way across the World in *less time* than it takes a software team to deliver its code from one datacenter to another sitting 10 miles away.
5272

5373
With Standard Containers we can put an end to that embarrassment, by making INDUSTRIAL-GRADE DELIVERY of software a reality.
5474

@@ -97,11 +117,8 @@ For example, this paragraph will span three lines in the Markdown source.
97117

98118
### Sign your work
99119

100-
The sign-off is a simple line at the end of the explanation for the
101-
patch, which certifies that you wrote it or otherwise have the right to
102-
pass it on as an open-source patch. The rules are pretty simple: if you
103-
can certify the below (from
104-
[developercertificate.org](http://developercertificate.org/)):
120+
The sign-off is a simple line at the end of the explanation for the patch, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch.
121+
The rules are pretty simple: if you can certify the below (from [developercertificate.org](http://developercertificate.org/)):
105122

106123
```
107124
Developer Certificate of Origin

bundle.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Bundle Container Format
22

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

5-
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.
6+
The format does not define distribution.
7+
In other words, it only specifies how a container must be stored on a local filesystem, for consumption by a runtime.
8+
It does not specify how to transfer a container between computers, how to discover containers, or assign names or versions to them.
9+
Any distribution method capable of preserving the original layout of a container, as specified here, is considered compliant.
610

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

config-linux.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Linux-specific configuration
22

3-
The Linux container specification uses various kernel features like namespaces,
4-
cgroups, capabilities, LSM, and file system jails to fulfill the spec.
5-
Additional information is needed for Linux over the [default spec configuration](config.md)
6-
in order to configure these various kernel features.
3+
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and file system jails to fulfill the spec.
4+
Additional information is needed for Linux over the [default spec configuration](config.md) in order to configure these various kernel features.
75

86
## Capabilities
97

10-
Capabilities is an array that specifies Linux capabilities that can be provided to the process
11-
inside the container. Valid values are the string after `CAP_` for capabilities defined
12-
in [the man page](http://man7.org/linux/man-pages/man7/capabilities.7.html)
8+
Capabilities is an array that specifies Linux capabilities that can be provided to the process inside the container.
9+
Valid values are the string after `CAP_` for capabilities defined in [the man page](http://man7.org/linux/man-pages/man7/capabilities.7.html).
1310

1411
```json
1512
"capabilities": [
@@ -21,7 +18,9 @@ in [the man page](http://man7.org/linux/man-pages/man7/capabilities.7.html)
2118

2219
## Rootfs Mount Propagation
2320

24-
rootfsPropagation sets the rootfs's mount propagation. Its value is either slave, private, or shared. [The kernel doc](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) has more information about mount propagation.
21+
rootfsPropagation sets the rootfs's mount propagation.
22+
Its value is either slave, private, or shared.
23+
[The kernel doc](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt) has more information about mount propagation.
2524

2625
```json
2726
"rootfsPropagation": "slave",

config.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,5 @@ For Linux-based systems the user structure has the following fields:
123123
}
124124
```
125125

126-
Interpretation of the platform section of the JSON file is used to find which platform-specific sections may be available in the document. For example, if `os` is set to `linux`, then a JSON object conforming to the [Linux-specific schema](config-linux.md) SHOULD be found at the key `linux` in the `config.json`.
126+
Interpretation of the platform section of the JSON file is used to find which platform-specific sections may be available in the document.
127+
For example, if `os` is set to `linux`, then a JSON object conforming to the [Linux-specific schema](config-linux.md) SHOULD be found at the key `linux` in the `config.json`.

runtime-config-linux.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ Next parameters can be specified:
127127

128128
## Control groups
129129

130-
Also known as cgroups, they are used to restrict resource usage for a container and handle
131-
device access. cgroups provide controls to restrict cpu, memory, IO, pids and network for
132-
the container. For more information, see the [kernel cgroups documentation](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt).
130+
Also known as cgroups, they are used to restrict resource usage for a container and handle device access.
131+
cgroups provide controls to restrict cpu, memory, IO, pids and network for the container.
132+
For more information, see the [kernel cgroups documentation](https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt).
133133

134134
## Sysctl
135135

@@ -155,7 +155,9 @@ For more information, see [the man page](http://man7.org/linux/man-pages/man8/sy
155155
]
156156
```
157157

158-
rlimits allow setting resource limits. The type is from the values defined in [the man page](http://man7.org/linux/man-pages/man2/setrlimit.2.html). The kernel enforces the soft limit for a resource while the hard limit acts as a ceiling for that value that could be set by an unprivileged process.
158+
rlimits allow setting resource limits.
159+
The type is from the values defined in [the man page](http://man7.org/linux/man-pages/man2/setrlimit.2.html).
160+
The kernel enforces the soft limit for a resource while the hard limit acts as a ceiling for that value that could be set by an unprivileged process.
159161

160162
## SELinux process label
161163

@@ -177,8 +179,7 @@ For more information about Apparmor, see [Apparmor documentation](https://wiki.u
177179
## seccomp
178180

179181
Seccomp provides application sandboxing mechanism in the Linux kernel.
180-
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows
181-
matching on values passed as arguments to syscalls.
182+
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls.
182183
For more information about Seccomp, see [Seccomp kernel documentation](https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt)
183184
The actions and operators are strings that match the definitions in seccomp.h from [libseccomp](https://github.com/seccomp/libseccomp) and are translated to corresponding values.
184185

runtime.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,35 @@ Creates the container: file system, namespaces, cgroups, capabilities.
3737

3838
### Start (process)
3939

40-
Runs a process in a container. Can be invoked several times.
40+
Runs a process in a container.
41+
Can be invoked several times.
4142

4243
### Stop (process)
4344

44-
Not sure we need that from runc cli. Process is killed from the outside.
45+
Not sure we need that from runc cli.
46+
Process is killed from the outside.
4547

4648
This event needs to be captured by runc to run onstop event handlers.
4749

4850
## Hooks
51+
4952
Hooks allow one to run code before/after various lifecycle events of the container.
5053
The state of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work.
5154

5255
Hook paths are absolute and are executed from the host's filesystem.
5356

5457
### Pre-start
58+
5559
The pre-start hooks are called after the container process is spawned, but before the user supplied command is executed.
5660
They are called after the container namespaces are created on Linux, so they provide an opportunity to customize the container.
5761
In Linux, for e.g., the network namespace could be configured in this hook.
5862

5963
If a hook returns a non-zero exit code, then an error including the exit code and the stderr is returned to the caller and the container is torn down.
6064

6165
### Post-stop
62-
The post-stop hooks are called after the container process is stopped. Cleanup or debugging could be performed in such a hook.
66+
67+
The post-stop hooks are called after the container process is stopped.
68+
Cleanup or debugging could be performed in such a hook.
6369
If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed.
6470

6571
*Example*
@@ -85,4 +91,5 @@ If a hook returns a non-zero exit code, then an error is logged and the remainin
8591
}
8692
```
8793

88-
`path` is required for a hook. `args` and `env` are optional.
94+
`path` is required for a hook.
95+
`args` and `env` are optional.

0 commit comments

Comments
 (0)