From d4cf636c9edba1846f65db42d992670d974f1b06 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Thu, 8 Jun 2017 17:25:44 -0700 Subject: [PATCH 1/2] config: relax specification of Config.Volumes Relaxes the specification of `Config.Volumes` by avoiding references to the concept of "data volumes". Implementors are merely instructed to provide mounts outside the container's root filesystem. Signed-off-by: Stephen J Day --- config.md | 5 +++-- specs-go/v1/config.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.md b/config.md index 116b6c16a..fdbe2d0f7 100644 --- a/config.md +++ b/config.md @@ -148,8 +148,9 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a - **Volumes** *object*, OPTIONAL - A set of directories which SHOULD be created as data volumes in a container running this image. - If a file or folder exists within the image with the same path as a data volume, that file or folder will be replaced by the data volume and never be merged. + A set of directories describing where the process is likely write data specific to a container instance. + Implementations SHOULD provide mounts for these locations such that application data is not written to the container's root filesystem. + If a _new_ image is created from a container based on the image described by this configuration, data in these paths SHOULD NOT be included in the _new_ image. **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. - **WorkingDir** *string*, OPTIONAL diff --git a/specs-go/v1/config.go b/specs-go/v1/config.go index 8475ff741..fe799bd69 100644 --- a/specs-go/v1/config.go +++ b/specs-go/v1/config.go @@ -37,7 +37,7 @@ type ImageConfig struct { // Cmd defines the default arguments to the entrypoint of the container. Cmd []string `json:"Cmd,omitempty"` - // Volumes is a set of directories which should be created as data volumes in a container running this image. + // Volumes is a set of directories describing where the process is likely write data specific to a container instance. Volumes map[string]struct{} `json:"Volumes,omitempty"` // WorkingDir sets the current working directory of the entrypoint process in the container. From 8f427212e0133f3f8aac472d6b101f3d2143e6a8 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Wed, 21 Jun 2017 14:26:10 -0700 Subject: [PATCH 2/2] config, conversion: move volume behavior to conversion Signed-off-by: Stephen J Day --- config.md | 2 -- conversion.md | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.md b/config.md index fdbe2d0f7..398296ae4 100644 --- a/config.md +++ b/config.md @@ -149,8 +149,6 @@ Note: Any OPTIONAL field MAY also be set to null, which is equivalent to being a - **Volumes** *object*, OPTIONAL A set of directories describing where the process is likely write data specific to a container instance. - Implementations SHOULD provide mounts for these locations such that application data is not written to the container's root filesystem. - If a _new_ image is created from a container based on the image described by this configuration, data in these paths SHOULD NOT be included in the _new_ image. **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. - **WorkingDir** *string*, OPTIONAL diff --git a/conversion.md b/conversion.md index 2e3d5feae..d35f872b5 100644 --- a/conversion.md +++ b/conversion.md @@ -90,7 +90,10 @@ A compliant configuration converter SHOULD provide a way for users to extract th 1. The runtime configuration does not have a corresponding field for this image field. However, converters SHOULD set the [`org.opencontainers.image.exposedPorts` annotation](#config.exposedports). -2. If a converter implements conversion for this field using mountpoints, it SHOULD set the `destination` of the mountpoint to the value specified in `Config.Volumes`. +2. Implementations SHOULD provide mounts for these locations such that application data is not written to the container's root filesystem. + If a converter implements conversion for this field using mountpoints, it SHOULD set the `destination` of the mountpoint to the value specified in `Config.Volumes`. + An implementation MAY seed the contents of the mount with data in the image at the same location. + If a _new_ image is created from a container based on the image described by this configuration, data in these paths SHOULD NOT be included in the _new_ image. The other `mounts` fields are platform and context dependent, and thus are implementation-defined. Note that the implementation of `Config.Volumes` need not use mountpoints, as it is effectively a mask of the filesystem.