v1

latestOpenAPI 3.0.02026-07-1410578280.2 KB
Exec

Create an exec instance

Run a command inside a running container.

post/containers/{id}/exec

Path parameters

idstring required

ID or name of container

Request body

AttachStderrboolean

Attach to stderr of the exec command.

AttachStdinboolean

Attach to stdin of the exec command.

AttachStdoutboolean

Attach to stdout of the exec command.

Cmdstring[]

Command to run, as a string or array of strings.

DetachKeysstring

Override the key sequence for detaching a container. Format is a single character [a-Z] or ctrl-<value> where <value> is one of: a-z, @, ^, [, , or _.

Envstring[]

A list of environment variables in the form ["VAR=value", ...].

Privilegedboolean

Runs the exec process with extended privileges.

Ttyboolean

Allocate a pseudo-TTY.

Userstring

The user, and optionally, group to run the exec process inside the container. Format is one of: user, user:group, uid, or uid:gid.

Example request

{
  "AttachStderr": true,
  "AttachStdin": false,
  "AttachStdout": true,
  "Cmd": [
    "date"
  ],
  "DetachKeys": "ctrl-p,ctrl-q",
  "Env": [
    "FOO=bar",
    "BAZ=quux"
  ],
  "Tty": false
}

Response

no error

Idstring required

The id of the newly created object.