Search or ask Docker

ContainerConfig

ContainerConfig schema in Docker Engine API 1.57.

View Markdown

Schema

Type: object

Configuration for a container that is portable between hosts.
ArgsEscaped

Type: boolean

Command is already escaped (Windows only)
All schema constraints and annotations
{
  "default": false,
  "description": "Command is already escaped (Windows only)",
  "example": false,
  "type": "boolean",
  "x-nullable": true
}
AttachStderr

Type: boolean

Whether to attach to stderr.
All schema constraints and annotations
{
  "default": true,
  "description": "Whether to attach to `stderr`.",
  "type": "boolean"
}
AttachStdin

Type: boolean

Whether to attach to stdin.
All schema constraints and annotations
{
  "default": false,
  "description": "Whether to attach to `stdin`.",
  "type": "boolean"
}
AttachStdout

Type: boolean

Whether to attach to stdout.
All schema constraints and annotations
{
  "default": true,
  "description": "Whether to attach to `stdout`.",
  "type": "boolean"
}
Cmd

Type: array

Command to run specified as a string or an array of strings.
Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "Command to run specified as a string or an array of strings.\n",
  "example": [
    "/bin/sh"
  ],
  "items": {
    "type": "string"
  },
  "type": "array"
}
Domainname

Type: string

The domain name to use for the container.
All schema constraints and annotations
{
  "description": "The domain name to use for the container.\n",
  "type": "string"
}
Entrypoint

Type: array

The entry point for the container as a string or an array of strings.

If the array consists of exactly one empty string ([""]) then the entry point is reset to system default (i.e., the entry point used by docker when there is no ENTRYPOINT instruction in the Dockerfile).

Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n",
  "example": [],
  "items": {
    "type": "string"
  },
  "type": "array"
}
Env

Type: array

A list of environment variables to set inside the container in the form ["VAR=value", ...]. A variable without = is removed from the environment, rather than to have an empty value.
Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n",
  "example": [
    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  ],
  "items": {
    "type": "string"
  },
  "type": "array"
}
ExposedPorts

Type: object

An object mapping ports to an empty object in the form:

{"<port>/<tcp|udp|sctp>": {}}

All schema constraints and annotations
{
  "additionalProperties": {
    "default": {},
    "enum": [
      {}
    ],
    "type": "object"
  },
  "description": "An object mapping ports to an empty object in the form:\n\n`{\"\u003cport\u003e/\u003ctcp|udp|sctp\u003e\": {}}`\n",
  "example": {
    "443/tcp": {},
    "80/tcp": {}
  },
  "type": "object",
  "x-nullable": true
}
Healthcheck

Schema: HealthConfig

Hostname

Type: string

The hostname to use for the container, as a valid RFC 1123 hostname.
All schema constraints and annotations
{
  "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n",
  "example": "439f4e91bd1d",
  "type": "string"
}
Image

Type: string

The name (or reference) of the image to use when creating the container, or which was used when the container was created.
All schema constraints and annotations
{
  "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n",
  "example": "example-image:1.0",
  "type": "string"
}
Labels

Type: object

User-defined key/value metadata.
All schema constraints and annotations
{
  "additionalProperties": {
    "type": "string"
  },
  "description": "User-defined key/value metadata.",
  "example": {
    "com.example.some-label": "some-value",
    "com.example.some-other-label": "some-other-value"
  },
  "type": "object"
}
NetworkDisabled

Type: boolean

Disable networking for the container.
All schema constraints and annotations
{
  "description": "Disable networking for the container.",
  "type": "boolean",
  "x-nullable": true
}
OnBuild

Type: array

ONBUILD metadata that were defined in the image's Dockerfile.
Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n",
  "example": [],
  "items": {
    "type": "string"
  },
  "type": "array",
  "x-nullable": true
}
OpenStdin

Type: boolean

Open stdin
All schema constraints and annotations
{
  "default": false,
  "description": "Open `stdin`",
  "type": "boolean"
}
Shell

Type: array

Shell for when RUN, CMD, and ENTRYPOINT uses a shell.
Array item

Type: string

All schema constraints and annotations
{
  "type": "string"
}
All schema constraints and annotations
{
  "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n",
  "example": [
    "/bin/sh",
    "-c"
  ],
  "items": {
    "type": "string"
  },
  "type": "array",
  "x-nullable": true
}
StdinOnce

Type: boolean

Close stdin after one attached client disconnects
All schema constraints and annotations
{
  "default": false,
  "description": "Close `stdin` after one attached client disconnects",
  "type": "boolean"
}
StopSignal

Type: string

Signal to stop a container as a string or unsigned integer.
All schema constraints and annotations
{
  "description": "Signal to stop a container as a string or unsigned integer.\n",
  "example": "SIGTERM",
  "type": "string",
  "x-nullable": true
}
StopTimeout

Type: integer

Timeout to stop a container in seconds. If omitted, the daemon-wide default (default-stop-timeout) is used.
All schema constraints and annotations
{
  "description": "Timeout to stop a container in seconds. If omitted, the daemon-wide\ndefault (`default-stop-timeout`) is used.\n",
  "type": "integer",
  "x-nullable": true
}
Tty

Type: boolean

Attach standard streams to a TTY, including stdin if it is not closed.
All schema constraints and annotations
{
  "default": false,
  "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n",
  "type": "boolean"
}
User

Type: string

Commands run as this user inside the container. If omitted, commands run as the user specified in the image the container was started from.

Can be either user-name or UID, and optional group-name or GID, separated by a colon (<user-name|UID>[<:group-name|GID>]).

All schema constraints and annotations
{
  "description": "Commands run as this user inside the container. If omitted, commands\nrun as the user specified in the image the container was started from.\n\nCan be either user-name or UID, and optional group-name or GID,\nseparated by a colon (`\u003cuser-name|UID\u003e[\u003c:group-name|GID\u003e]`).",
  "example": "123:456",
  "type": "string"
}
Volumes

Type: object

An object mapping mount point paths inside the container to empty objects.
All schema constraints and annotations
{
  "additionalProperties": {
    "default": {},
    "enum": [
      {}
    ],
    "type": "object"
  },
  "description": "An object mapping mount point paths inside the container to empty\nobjects.\n",
  "type": "object"
}
WorkingDir

Type: string

The working directory for commands to run in.
All schema constraints and annotations
{
  "description": "The working directory for commands to run in.",
  "example": "/public/",
  "type": "string"
}
All schema constraints and annotations
{
  "description": "Configuration for a container that is portable between hosts.\n",
  "properties": {
    "ArgsEscaped": {
      "default": false,
      "description": "Command is already escaped (Windows only)",
      "example": false,
      "type": "boolean",
      "x-nullable": true
    },
    "AttachStderr": {
      "default": true,
      "description": "Whether to attach to `stderr`.",
      "type": "boolean"
    },
    "AttachStdin": {
      "default": false,
      "description": "Whether to attach to `stdin`.",
      "type": "boolean"
    },
    "AttachStdout": {
      "default": true,
      "description": "Whether to attach to `stdout`.",
      "type": "boolean"
    },
    "Cmd": {
      "description": "Command to run specified as a string or an array of strings.\n",
      "example": [
        "/bin/sh"
      ],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "Domainname": {
      "description": "The domain name to use for the container.\n",
      "type": "string"
    },
    "Entrypoint": {
      "description": "The entry point for the container as a string or an array of strings.\n\nIf the array consists of exactly one empty string (`[\"\"]`) then the\nentry point is reset to system default (i.e., the entry point used by\ndocker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).\n",
      "example": [],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "Env": {
      "description": "A list of environment variables to set inside the container in the\nform `[\"VAR=value\", ...]`. A variable without `=` is removed from the\nenvironment, rather than to have an empty value.\n",
      "example": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
      ],
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "ExposedPorts": {
      "additionalProperties": {
        "default": {},
        "enum": [
          {}
        ],
        "type": "object"
      },
      "description": "An object mapping ports to an empty object in the form:\n\n`{\"\u003cport\u003e/\u003ctcp|udp|sctp\u003e\": {}}`\n",
      "example": {
        "443/tcp": {},
        "80/tcp": {}
      },
      "type": "object",
      "x-nullable": true
    },
    "Healthcheck": {
      "$ref": "#/components/schemas/HealthConfig"
    },
    "Hostname": {
      "description": "The hostname to use for the container, as a valid RFC 1123 hostname.\n",
      "example": "439f4e91bd1d",
      "type": "string"
    },
    "Image": {
      "description": "The name (or reference) of the image to use when creating the container,\nor which was used when the container was created.\n",
      "example": "example-image:1.0",
      "type": "string"
    },
    "Labels": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "User-defined key/value metadata.",
      "example": {
        "com.example.some-label": "some-value",
        "com.example.some-other-label": "some-other-value"
      },
      "type": "object"
    },
    "NetworkDisabled": {
      "description": "Disable networking for the container.",
      "type": "boolean",
      "x-nullable": true
    },
    "OnBuild": {
      "description": "`ONBUILD` metadata that were defined in the image's `Dockerfile`.\n",
      "example": [],
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-nullable": true
    },
    "OpenStdin": {
      "default": false,
      "description": "Open `stdin`",
      "type": "boolean"
    },
    "Shell": {
      "description": "Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.\n",
      "example": [
        "/bin/sh",
        "-c"
      ],
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-nullable": true
    },
    "StdinOnce": {
      "default": false,
      "description": "Close `stdin` after one attached client disconnects",
      "type": "boolean"
    },
    "StopSignal": {
      "description": "Signal to stop a container as a string or unsigned integer.\n",
      "example": "SIGTERM",
      "type": "string",
      "x-nullable": true
    },
    "StopTimeout": {
      "description": "Timeout to stop a container in seconds. If omitted, the daemon-wide\ndefault (`default-stop-timeout`) is used.\n",
      "type": "integer",
      "x-nullable": true
    },
    "Tty": {
      "default": false,
      "description": "Attach standard streams to a TTY, including `stdin` if it is not closed.\n",
      "type": "boolean"
    },
    "User": {
      "description": "Commands run as this user inside the container. If omitted, commands\nrun as the user specified in the image the container was started from.\n\nCan be either user-name or UID, and optional group-name or GID,\nseparated by a colon (`\u003cuser-name|UID\u003e[\u003c:group-name|GID\u003e]`).",
      "example": "123:456",
      "type": "string"
    },
    "Volumes": {
      "additionalProperties": {
        "default": {},
        "enum": [
          {}
        ],
        "type": "object"
      },
      "description": "An object mapping mount point paths inside the container to empty\nobjects.\n",
      "type": "object"
    },
    "WorkingDir": {
      "description": "The working directory for commands to run in.",
      "example": "/public/",
      "type": "string"
    }
  },
  "type": "object"
}