Bläddra i källkod

Merge pull request #9263 from cpuguy83/docs_cleanup_exec_api

Cleanup exec API docs and available params
Jessie Frazelle 10 år sedan
förälder
incheckning
39284be960

+ 0 - 2
daemon/exec.go

@@ -122,8 +122,6 @@ func (d *Daemon) ContainerExecCreate(job *engine.Job) engine.Status {
 	entrypoint, args := d.getEntrypointAndArgs(nil, config.Cmd)
 	entrypoint, args := d.getEntrypointAndArgs(nil, config.Cmd)
 
 
 	processConfig := execdriver.ProcessConfig{
 	processConfig := execdriver.ProcessConfig{
-		Privileged: config.Privileged,
-		User:       config.User,
 		Tty:        config.Tty,
 		Tty:        config.Tty,
 		Entrypoint: entrypoint,
 		Entrypoint: entrypoint,
 		Arguments:  args,
 		Arguments:  args,

+ 11 - 5
docs/sources/reference/api/docker_remote_api_v1.15.md

@@ -1561,7 +1561,6 @@ Sets up an exec instance in a running container `id`
 	     "Cmd":[
 	     "Cmd":[
                      "date"
                      "date"
              ],
              ],
-	     "Container":"e90e34656806",
         }
         }
 
 
 **Example response**:
 **Example response**:
@@ -1575,7 +1574,12 @@ Sets up an exec instance in a running container `id`
 
 
 Json Parameters:
 Json Parameters:
 
 
--   **execConfig** ? exec configuration.
+-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.
+-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.
+-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.
+-   **Tty** - Boolean value to allocate a pseudo-TTY
+-   **Cmd** - Command to run specified as a string or an array of strings.
+
 
 
 Status Codes:
 Status Codes:
 
 
@@ -1586,8 +1590,9 @@ Status Codes:
 
 
 `POST /exec/(id)/start`
 `POST /exec/(id)/start`
 
 
-Starts a previously set up exec instance `id`. If `detach` is true, this API returns after
-starting the `exec` command. Otherwise, this API sets up an interactive session with the `exec` command.
+Starts a previously set up exec instance `id`. If `detach` is true, this API
+returns after starting the `exec` command. Otherwise, this API sets up an
+interactive session with the `exec` command.
 
 
 **Example request**:
 **Example request**:
 
 
@@ -1608,7 +1613,8 @@ starting the `exec` command. Otherwise, this API sets up an interactive session
 
 
 Json Parameters:
 Json Parameters:
 
 
--   **execConfig** ? exec configuration.
+-   **Detach** - Detach from the exec command
+-   **Tty** - Boolean value to allocate a pseudo-TTY
 
 
 Status Codes:
 Status Codes:
 
 

+ 11 - 5
docs/sources/reference/api/docker_remote_api_v1.16.md

@@ -1515,7 +1515,6 @@ Sets up an exec instance in a running container `id`
 	     "Cmd":[
 	     "Cmd":[
                      "date"
                      "date"
              ],
              ],
-	     "Container":"e90e34656806",
         }
         }
 
 
 **Example response**:
 **Example response**:
@@ -1529,7 +1528,12 @@ Sets up an exec instance in a running container `id`
 
 
 Json Parameters:
 Json Parameters:
 
 
--   **execConfig** ? exec configuration.
+-   **AttachStdin** - Boolean value, attaches to stdin of the exec command.
+-   **AttachStdout** - Boolean value, attaches to stdout of the exec command.
+-   **AttachStderr** - Boolean value, attaches to stderr of the exec command.
+-   **Tty** - Boolean value to allocate a pseudo-TTY
+-   **Cmd** - Command to run specified as a string or an array of strings.
+
 
 
 Status Codes:
 Status Codes:
 
 
@@ -1540,8 +1544,9 @@ Status Codes:
 
 
 `POST /exec/(id)/start`
 `POST /exec/(id)/start`
 
 
-Starts a previously set up exec instance `id`. If `detach` is true, this API returns after
-starting the `exec` command. Otherwise, this API sets up an interactive session with the `exec` command.
+Starts a previously set up exec instance `id`. If `detach` is true, this API
+returns after starting the `exec` command. Otherwise, this API sets up an
+interactive session with the `exec` command.
 
 
 **Example request**:
 **Example request**:
 
 
@@ -1562,7 +1567,8 @@ starting the `exec` command. Otherwise, this API sets up an interactive session
 
 
 Json Parameters:
 Json Parameters:
 
 
--   **execConfig** ? exec configuration.
+-   **Detach** - Detach from the exec command
+-   **Tty** - Boolean value to allocate a pseudo-TTY
 
 
 Status Codes:
 Status Codes:
 
 

+ 4 - 3
runconfig/exec.go

@@ -19,10 +19,11 @@ type ExecConfig struct {
 
 
 func ExecConfigFromJob(job *engine.Job) *ExecConfig {
 func ExecConfigFromJob(job *engine.Job) *ExecConfig {
 	execConfig := &ExecConfig{
 	execConfig := &ExecConfig{
-		User:         job.Getenv("User"),
-		Privileged:   job.GetenvBool("Privileged"),
+		// TODO(vishh): Expose 'User' once it is supported.
+		//User:         job.Getenv("User"),
+		// TODO(vishh): Expose 'Privileged' once it is supported.
+		//Privileged:   job.GetenvBool("Privileged"),
 		Tty:          job.GetenvBool("Tty"),
 		Tty:          job.GetenvBool("Tty"),
-		Container:    job.Getenv("Container"),
 		AttachStdin:  job.GetenvBool("AttachStdin"),
 		AttachStdin:  job.GetenvBool("AttachStdin"),
 		AttachStderr: job.GetenvBool("AttachStderr"),
 		AttachStderr: job.GetenvBool("AttachStderr"),
 		AttachStdout: job.GetenvBool("AttachStdout"),
 		AttachStdout: job.GetenvBool("AttachStdout"),