From f31b19f6f194e932eda52b741396ac9fa0056cfc Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 14 Sep 2016 13:12:21 -0700 Subject: [PATCH] config: Add consoleSize to process Signed-off-by: John Howard --- config.md | 9 +++++++++ specs-go/config.go | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/config.md b/config.md index 26287b38e..17027775f 100644 --- a/config.md +++ b/config.md @@ -95,6 +95,7 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se **`process`** (object, REQUIRED) configures the container process. * **`terminal`** (bool, OPTIONAL) specifies whether you want a terminal attached to that process, defaults to false. +* **`consoleSize`** (box, OPTIONAL) specifies the console size of the terminal if attached. * **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable. This value MUST be an absolute path. * **`env`** (array of strings, OPTIONAL) contains a list of variables that will be set in the process's environment prior to execution. @@ -139,6 +140,10 @@ _Note: For Solaris, uid and gid specify the uid and gid of the process inside th ```json "process": { "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, "user": { "uid": 1, "gid": 1, @@ -174,6 +179,10 @@ _Note: For Solaris, uid and gid specify the uid and gid of the process inside th ```json "process": { "terminal": true, + "consoleSize": { + "height": 25, + "width": 80 + }, "user": { "uid": 1, "gid": 1, diff --git a/specs-go/config.go b/specs-go/config.go index 4733a1a62..420839440 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -31,6 +31,8 @@ type Spec struct { type Process struct { // Terminal creates an interactive terminal for the container. Terminal bool `json:"terminal,omitempty"` + // ConsoleSize specifies the size of the console. + ConsoleSize Box `json:"consoleSize,omitempty"` // User specifies user information for the process. User User `json:"user"` // Args specifies the binary and arguments for the application to execute. @@ -52,6 +54,14 @@ type Process struct { SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` } +// Box specifies dimensions of a rectangle. Used for specifying the size of a console. +type Box struct { + // Height is the vertical dimension of a box. + Height uint `json:"height"` + // Width is the horizontal dimension of a box. + Width uint `json:"width"` +} + // User specifies specific user (and group) information for the container process. type User struct { // UID is the user id.