Skip to content

Conversation

philips
Copy link
Contributor

@philips philips commented Sep 21, 2016

Reformat this file to look more like manifest.md and add
OPTIONAL/REQUIRED tags on all fields.

Fixes #251

@philips philips force-pushed the add-optiona-required-config branch from c1b986d to d47024d Compare September 21, 2016 02:35
Reformat this file to look more like manifest.md and add
OPTIONAL/REQUIRED tags on all fields.

Fixes opencontainers#251

Signed-off-by: Brandon Philips <[email protected]>
@philips philips force-pushed the add-optiona-required-config branch from d47024d to f3d0f78 Compare September 21, 2016 02:41
Caught by @coolljt072 and rebased here in markdown format.

Signed-off-by: Brandon Philips <[email protected]>
config.md Outdated
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null".
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object.

- **WorkingDir** *string*, REQUIRED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the config is OPTIONAL, but WorkingDir is REQUIRED? I think all the filed in config is OPTIONAL :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean if config is not null, then the WorkingDir is REQUIRED?

config.md Outdated

A custom message set when creating the layer.

- **empty_layer** *string*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a Boolean, not a string

@wking
Copy link
Contributor

wking commented Sep 21, 2016

On Tue, Sep 20, 2016 at 08:36:59PM -0700, Lei Jitang wrote:

    • WorkingDir string, REQUIRED

why the config is OPTIONAL, but WorkingDir is REQUIRED? I think
all the filed in config is OPTIONAL :)

This means that if you set ‘config’ you MUST set ‘config.WorkingDir’.
And it's probably required because the runtime-spec requires
process.cwd 1. I've filed opencontainers/runtime-spec#489 to relax
the process.args requirement, and if that ever gets legs I may file a
follow-up relaxing process.cwd. But until the runtime-spec relaxes
the requirement (possibly never), I think image-spec is best off
reinventing as little of the wheel as possible ;).

config.md Outdated
</dl>
- **created** *string*, OPTIONAL

A ISO-8601 formatted combined date and time at which the image was created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“A ISO” → “An ISO”.

config.md Outdated
- **config** *object*, OPTIONAL

The execution parameters which should be used as a base when running a container using the image.
This field can be <code>null</code>, in which case any execution parameters should be specified at creation of the container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated
The execution parameters which should be used as a base when running a container using the image.
This field can be <code>null</code>, in which case any execution parameters should be specified at creation of the container.

- **user** *string*, OPTIONAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously title-case, and as of 403a1af specs-go/v1/config.go still has:

User string `json:"User"`

config.md Outdated

The username or UID which the process in the container should run as.
This acts as a default value to use when the value is not specified when creating a container.
All of the following are valid: `user`, `uid`, `user:group`, `uid:gid`, `uid:group`, `uiser:gid`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uiser:giduser:gid.

config.md Outdated
A layer DiffID is a SHA256 digest over the layer's uncompressed tar archive and serialized in the descriptor digest format, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
Layers must be packed and unpacked reproducibly to avoid changing the layer DiffID, for example by using tar-split to save the tar headers.

NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for <code>application/vnd.oci.image.layer.tar+gzip</code> types.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated

- **MemorySwap** *integer*, OPTIONAL

Total memory usage (memory + swap); set to <code>-1</code> to disable swap.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated
Its keys can be in the format of:
`port/tcp`, `port/udp`, `port` with the default protocol being `tcp` if not specified.
These values act as defaults and are merged with any specified when creating a container.
**NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated

- **Env** *array of strings*, OPTIONAL

Entries are in the format of <code>VARNAME="var value"</code>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated
- **Entrypoint** *array of strings*

A list of arguments to use as the command to execute when the container starts.
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be "null".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"null"null?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove the doubled space: “as a default“ → “as a default”. And move “This field MAY be null” to its own line.

config.md Outdated

- **Volumes** *object*, OPTIONAL
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null".
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<code> → backticks.

config.md Outdated

Describes the history of each layer.
The array is ordered from bottom-most layer to top-most layer.
The object has the following fields:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indents?

config.md Outdated
The array is ordered from bottom-most layer to top-most layer.
The object has the following fields:

- **created** *string*, OPTIONAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Four-space indents for sub-lists (opencontainers/runtime-spec#495).

config.md Outdated

- **empty_layer** *string*

This field is used to mark if the history item created a filesystem diff, OPTIONAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“OPTIONAL“ should go on the line with empty_layer, like you do with all the other properties.

config.md Outdated
Sets the current working directory of the entrypoint process in the container.
This value acts as a default and is replaced by a working directory specified when creating a container.

- **rootfs** *object, REQUIRED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*object -> *object*

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still lack of a * at the end of object. It looks like
rootfs *object, REQUIRED

config.md Outdated
If an `Entrypoint` value is not specified, then the first entry of the `Cmd` array should be interpreted as the executable to run.

- **Volumes** *object*, OPTIONAL
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have a blang line after **Volumes** *object*, OPTIONAL


Each image has an associated JSON structure which describes some basic information about the image such as date created, author, and the ID of its parent image as well as execution/runtime configuration like its entrypoint, default arguments, CPU/memory shares, networking, and volumes.
The JSON structure also references a cryptographic hash of each layer used by the image, and provides history information for those layers.
This JSON is considered to be immutable, because changing it would change the computed ImageID.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new commit carrying #301, which changes ImageID[ImageID](#imageid)?


Each image's ID is given by the SHA256 hash of its configuration JSON.
It is represented as a hexadecimal encoding of 256 bits, e.g., <code>sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9</code>.
Since the configuration JSON that gets hashed references hashes of each layer in the image, this formulation of the ImageID makes images content-addresable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new commit carrying #301, which changes configuration JSONconfiguration JSON, both on this line and the “Each image's ID…” line two above it?

- use correct indentation for sub lists
- address some missing OPTIONAL tags
- random formatting issues.

Thanks @coolljt0725 and @wking for the review.

Signed-off-by: Brandon Philips <[email protected]>
@philips philips force-pushed the add-optiona-required-config branch from 629abd5 to 5d8014e Compare September 21, 2016 22:30
@philips
Copy link
Contributor Author

philips commented Sep 21, 2016

Addressed @coolljt0725 and @wking

@philips philips added this to the v1.0.0-rc1 milestone Sep 21, 2016
config.md Outdated

An array of layer content hashes (`DiffIDs`), in order from bottom-most to top-most.

- **history** *array of object*, REQUIRED
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“array of object” → “array of objects”

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is history OPTIONAL? since all the filed in history is optional

- **Volumes** *object*, OPTIONAL

A set of directories which should be created as data volumes in a container running this image. This field MAY be null.
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type `map[string]struct{}` and is represented in JSON as an object mapping its keys to an empty object.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split this into separate lines for each sentence.


Each image's ID is given by the SHA256 hash of its configuration JSON.
It is represented as a hexadecimal encoding of 256 bits, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
Since the configuration JSON that gets hashed references hashes of each layer in the image, this formulation of the ImageID makes images content-addresable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still needs “configuration JSON” links carried from #301.

config.md Outdated

- **empty_layer** *boolean*, OPTIONAL

This field is used to mark if the history item created a filesystem diff, OPTIONAL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“, OPTIONAL” → “.” (you say empty_layer is optional two lines above)

config.md Outdated

- **created** *string*, OPTIONAL

Creation time, expressed as a ISO-8601 formatted combined date and time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“a ISO” → “an ISO”.

config.md Outdated
- **Entrypoint** *array of strings*, OPTIONAL

A list of arguments to use as the command to execute when the container starts.
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be null.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has a doubled space in “as a default”.

Some duplicate spaces and duplicate words.

Signed-off-by: Brandon Philips <[email protected]>
@philips
Copy link
Contributor Author

philips commented Sep 22, 2016

I think this is g2g @opencontainers/image-spec-maintainers

@vbatts
Copy link
Member

vbatts commented Sep 22, 2016

Pretty huge overhaul.
/me 👀

@wking
Copy link
Contributor

wking commented Sep 22, 2016

On Thu, Sep 22, 2016 at 12:01:30PM -0700, Brandon Philips wrote:

I think this is g2g @opencontainers/image-spec-maintainers

As of 85138c9 there are still a number of unaddressed comments on the
current diff:

  • Carrying some links from Add some links in config.md #301 [1,2].
  • Splitting to one sentence per line 3.
  • Fixing a dangling ‘*object’ 4.
  • Fixing a missing plural 5.
  • Making ‘history’ OPTIONAL 6, since everything inside it is OPTIONAL.
  • Fixing “a ISO” 7.

@vbatts
Copy link
Member

vbatts commented Sep 22, 2016

There are a couple of questions on the choices made for OPTIONAL/REQUIRED

@philips
Copy link
Contributor Author

philips commented Sep 22, 2016

@vbatts what are the questions?


Here is an example rootfs section:

<pre>"rootfs": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we dropping the examples?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a big example at the end which gets verified vs. the JSON Schema. I think that's sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevvooe Right, I came to the same conclusion as @wking. The examples in the middle of the spec weren't being verified and the sub-objects aren't really stand alone anyways.

The other downside of adding them back in is it makes formatting into markdown impossible and I need to go back to HTML (or find some hack with a mix).

philips pushed a commit to philips/image-spec that referenced this pull request Sep 27, 2016
Various markdown, and grammar issues summarized here: opencontainers#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.
Various markdown, and grammar issues summarized here: opencontainers#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
@philips philips force-pushed the add-optiona-required-config branch from 8d58c72 to 974ac79 Compare September 27, 2016 05:36
@philips
Copy link
Contributor Author

philips commented Sep 27, 2016

@wking I addressed all but the link from #301 in 974ac79. We can punt that discussion about adding readability links once this material change to the spec lands.

@jonboulle
Copy link
Contributor

jonboulle commented Sep 27, 2016

LGTM. Read over this and seems fine. It'll be much easier to land subsequent changes too.

Approved with PullApprove

@vbatts
Copy link
Member

vbatts commented Sep 27, 2016

Thanks for updating it.
LGTM

Approved with PullApprove

@vbatts vbatts merged commit 6744414 into opencontainers:master Sep 27, 2016
wking added a commit to wking/image-spec that referenced this pull request Sep 27, 2016
Originally proposed by Lei Jitang in 28743f6 (Add some links in
config.md, 2016-09-18, opencontainers#301) and not carried by opencontainers#333 [1].

[1]: opencontainers#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/image-spec that referenced this pull request Nov 5, 2016
Covering all cases turned up by:

  $ git grep '\*array'

runtime-spec does this pretty consistently, and the first such usage
appeared in image-spec with f3d0f78 (config: reformat and add
optional/required, 2016-09-20, opencontainers#333).

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/image-spec that referenced this pull request Nov 5, 2016
Covering all cases turned up by:

  $ git grep '\*array'

runtime-spec does this pretty consistently, and the first such usage
appeared in image-spec with f3d0f78 (config: reformat and add
optional/required, 2016-09-20, opencontainers#333).  And before that, c22ca79
(serialization: docker v1 image format media type, 2016-04-04, opencontainers#6) had
landed some:

  <code>array of strings</code>

Signed-off-by: W. Trevor King <[email protected]>
dattgoswami9lk5g added a commit to dattgoswami9lk5g/bremlinr that referenced this pull request Jun 6, 2022
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
dattgoswami9lk5g added a commit to dattgoswami9lk5g/bremlinr that referenced this pull request Jun 6, 2022
Originally proposed by Lei Jitang in 28743f6c (Add some links in
config.md, 2016-09-18, #301) and not carried by #333 [1].

[1]: opencontainers/image-spec#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
dattgoswami9lk5g added a commit to dattgoswami9lk5g/bremlinr that referenced this pull request Jun 6, 2022
7c00d pushed a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
7c00d pushed a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Originally proposed by Lei Jitang in 28743f6c (Add some links in
config.md, 2016-09-18, #301) and not carried by #333 [1].

[1]: opencontainers/image-spec#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
7c00d pushed a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
7c00d added a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
7c00d added a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
Originally proposed by Lei Jitang in 28743f6c (Add some links in
config.md, 2016-09-18, #301) and not carried by #333 [1].

[1]: opencontainers/image-spec#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
7c00d added a commit to 7c00d/J1nHyeockKim that referenced this pull request Jun 6, 2022
laventuraw added a commit to laventuraw/Kihara-tony0 that referenced this pull request Jun 6, 2022
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
laventuraw added a commit to laventuraw/Kihara-tony0 that referenced this pull request Jun 6, 2022
Originally proposed by Lei Jitang in 28743f6c (Add some links in
config.md, 2016-09-18, #301) and not carried by #333 [1].

[1]: opencontainers/image-spec#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
laventuraw added a commit to laventuraw/Kihara-tony0 that referenced this pull request Jun 6, 2022
tomalopbsr0tt added a commit to tomalopbsr0tt/fabiojosej that referenced this pull request Oct 6, 2022
Various markdown, and grammar issues summarized here: opencontainers/image-spec#333 (comment)

Thank you to wking and coolljt0725 for the detailed review.

Signed-off-by: Brandon Philips <[email protected]>
tomalopbsr0tt added a commit to tomalopbsr0tt/fabiojosej that referenced this pull request Oct 6, 2022
Originally proposed by Lei Jitang in 28743f6c (Add some links in
config.md, 2016-09-18, #301) and not carried by #333 [1].

[1]: opencontainers/image-spec#333 (comment)

Signed-off-by: W. Trevor King <[email protected]>
tomalopbsr0tt added a commit to tomalopbsr0tt/fabiojosej that referenced this pull request Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants