Skip to content

Commit 4801054

Browse files
committed
config: Adjust process.env to drop name charset limitations
More closely following POSIX's phrasing: These strings have the form name=value; names shall not contain the character '='. For values to be portable across systems conforming to IEEE Std 1003.1-2001, the value shall be composed of characters from the portable character set (except NUL and as indicated below). The uppercase letter, digit, underscore restriction is just for "variables used by the utilities in the Shell and Utilities volume of IEEE Std 1003.1-2001". I've left off the charset requirement; we're punting to POSIX and copying that over and then linking to POSIX didn't seem like much gain. Just point people at POSIX and let them read about the charset suggestions there. The MUST NOT bit isn't particularly useful, and just rules out the '=value' case (which would have an empty name). A rephrasing of the requirement (which I didn't use, because it seemed too different from the POSIX wording) would be: These strings MUST contain the character '=' and MUST NOT have '=' as the first character. Also link specifically to chapter 8 section 1 (instead of just chapter 8). The "platform-appropriate way" wording comes from Rob Dolin [1], and gives space for non-POSIX systems to define their own environment variable format (and hopefully include links to their specifications in the spec as well). [1]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-54 Signed-off-by: W. Trevor King <[email protected]>
1 parent 5d27f3a commit 4801054

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se
8888

8989
* **`terminal`** (bool, optional) specifies whether you want a terminal attached to that process. Defaults to false.
9090
* **`cwd`** (string, required) is the working directory that will be set for the executable. This value MUST be an absolute path.
91-
* **`env`** (array of strings, optional) contains a list of variables that will be set in the process's environment prior to execution. Elements in the array are specified as Strings in the form "KEY=value". The left hand side MUST consist solely of letters, digits, and underscores `_` as outlined in [IEEE Std 1003.1-2001](http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html).
91+
* **`env`** (array of strings, optional) contains a list of variables that will be set in the process's environment prior to execution.
92+
Elements in the array are specified in a platform-appropriate way.
93+
On POSIX platforms the strings MUST have the form *name=value*, where *name* MUST NOT contain the character `=`, as outlined in [IEEE Std 1003.1-2001][ieee-1003.1-2001-xbd-c8.1].
9294
* **`args`** (array of strings, required) executable to launch and any flags as an array. The executable is the first element and MUST be available at the given path inside of the rootfs. If the executable path is not an absolute path then the search $PATH is interpreted to find the executable.
9395

9496
For Linux-based systems the process structure supports the following process specific fields:
@@ -662,5 +664,6 @@ Here is a full example `config.json` for reference.
662664
}
663665
```
664666

667+
[ieee-1003.1-2001-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#tag_08_01
665668
[runtime-namespace]: glossary.md#runtime-namespace
666669
[uts-namespace]: http://man7.org/linux/man-pages/man7/namespaces.7.html

0 commit comments

Comments
 (0)