# HostConfig


[API catalog](/reference/api/) · [Docker Engine overview](/reference/api/engine/version/v1.57/) · [Product manual](https://docs.docker.com/engine/) · [OpenAPI specification](/reference/api/engine/version/v1.57.yaml)

API version: 1.57





Schema constraints and annotations:

```json
{
  "allOf": [
    {
      "$ref": "#/components/schemas/Resources"
    },
    {
      "properties": {
        "Annotations": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Arbitrary non-identifying metadata attached to container and\nprovided to the runtime when the container is started.\n",
          "type": "object"
        },
        "AutoRemove": {
          "description": "Automatically remove the container when the container's process\nexits. This has no effect if `RestartPolicy` is set.\n",
          "type": "boolean"
        },
        "Binds": {
          "description": "A list of volume bindings for this container. Each volume binding\nis a string in one of these forms:\n\n- `host-src:container-dest[:options]` to bind-mount a host path\n  into the container. Both `host-src`, and `container-dest` must\n  be an _absolute_ path.\n- `volume-name:container-dest[:options]` to bind-mount a volume\n  managed by a volume driver into the container. `container-dest`\n  must be an _absolute_ path.\n\n`options` is an optional, comma-delimited list of:\n\n- `nocopy` disables automatic copying of data from the container\n  path to the volume. The `nocopy` flag only applies to named volumes.\n- `[ro|rw]` mounts a volume read-only or read-write, respectively.\n  If omitted or set to `rw`, volumes are mounted read-write.\n- `[z|Z]` applies SELinux labels to allow or deny multiple containers\n  to read and write to the same volume.\n    - `z`: a _shared_ content label is applied to the content. This\n      label indicates that multiple containers can share the volume\n      content, for both reading and writing.\n    - `Z`: a _private unshared_ label is applied to the content.\n      This label indicates that only the current container can use\n      a private volume. Labeling systems such as SELinux require\n      proper labels to be placed on volume content that is mounted\n      into a container. Without a label, the security system can\n      prevent a container's processes from using the content. By\n      default, the labels set by the host operating system are not\n      modified.\n- `[[r]shared|[r]slave|[r]private]` specifies mount\n  [propagation behavior](https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt).\n  This only applies to bind-mounted volumes, not internal volumes\n  or named volumes. Mount propagation requires the source mount\n  point (the location where the source directory is mounted in the\n  host operating system) to have the correct propagation properties.\n  For shared volumes, the source mount point must be set to `shared`.\n  For slave volumes, the mount must be set to either `shared` or\n  `slave`.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "CapAdd": {
          "description": "A list of kernel capabilities to add to the container. Conflicts\nwith option 'Capabilities'.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "CapDrop": {
          "description": "A list of kernel capabilities to drop from the container. Conflicts\nwith option 'Capabilities'.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "Cgroup": {
          "description": "Cgroup to use for the container.",
          "type": "string"
        },
        "CgroupnsMode": {
          "description": "cgroup namespace mode for the container. Possible values are:\n\n- `\"private\"`: the container runs in its own private cgroup namespace\n- `\"host\"`: use the host system's cgroup namespace\n\nIf not specified, the daemon default is used, which can either be `\"private\"`\nor `\"host\"`, depending on daemon version, kernel support and configuration.\n",
          "enum": [
            "private",
            "host"
          ],
          "type": "string"
        },
        "ConsoleSize": {
          "description": "Initial console size, as an `[height, width]` array.\n",
          "example": [
            80,
            64
          ],
          "items": {
            "minimum": 0,
            "type": "integer"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array",
          "x-nullable": true
        },
        "ContainerIDFile": {
          "description": "Path to a file where the container ID is written",
          "example": "",
          "type": "string"
        },
        "Dns": {
          "description": "A list of DNS servers for the container to use.",
          "items": {
            "format": "ip-address",
            "type": "string",
            "x-go-type": {
              "import": {
                "package": "net/netip"
              },
              "type": "Addr"
            }
          },
          "type": "array"
        },
        "DnsOptions": {
          "description": "A list of DNS options.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "DnsSearch": {
          "description": "A list of DNS search domains.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "ExtraHosts": {
          "description": "A list of hostnames/IP mappings to add to the container's `/etc/hosts`\nfile. Specified in the form `[\"hostname:IP\"]`.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "GroupAdd": {
          "description": "A list of additional groups that the container process will run as.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "IpcMode": {
          "description": "IPC sharing mode for the container. Possible values are:\n\n- `\"none\"`: own private IPC namespace, with /dev/shm not mounted\n- `\"private\"`: own private IPC namespace\n- `\"shareable\"`: own private IPC namespace, with a possibility to share it with other containers\n- `\"container:\u003cname|id\u003e\"`: join another (shareable) container's IPC namespace\n- `\"host\"`: use the host system's IPC namespace\n\nIf not specified, daemon default is used, which can either be `\"private\"`\nor `\"shareable\"`, depending on daemon version and configuration.\n",
          "type": "string"
        },
        "Isolation": {
          "description": "Isolation technology of the container. (Windows only)\n",
          "enum": [
            "default",
            "process",
            "hyperv",
            ""
          ],
          "type": "string"
        },
        "Links": {
          "description": "A list of links for the container in the form `container_name:alias`.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "LogConfig": {
          "description": "The logging configuration for this container",
          "properties": {
            "Config": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Driver-specific configuration options for the logging driver.",
              "example": {
                "max-file": "5",
                "max-size": "10m"
              },
              "type": "object"
            },
            "Type": {
              "description": "Name of the logging driver used for the container or \"none\"\nif logging is disabled.",
              "enum": [
                "local",
                "json-file",
                "syslog",
                "journald",
                "gelf",
                "fluentd",
                "awslogs",
                "splunk",
                "etwlogs",
                "none"
              ],
              "type": "string"
            }
          },
          "type": "object"
        },
        "MaskedPaths": {
          "description": "The list of paths to be masked inside the container (this overrides\nthe default set of paths).\n",
          "example": [
            "/proc/asound",
            "/proc/acpi",
            "/proc/kcore",
            "/proc/keys",
            "/proc/latency_stats",
            "/proc/timer_list",
            "/proc/timer_stats",
            "/proc/sched_debug",
            "/proc/scsi",
            "/sys/firmware",
            "/sys/devices/virtual/powercap"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "Mounts": {
          "description": "Specification for mounts to be added to the container.\n",
          "items": {
            "$ref": "#/components/schemas/Mount"
          },
          "type": "array"
        },
        "NetworkMode": {
          "description": "Network mode to use for this container. Supported standard values\nare: `bridge`, `host`, `none`, and `container:\u003cname|id\u003e`. Any\nother value is taken as a custom network's name to which this\ncontainer should connect to.\n",
          "type": "string"
        },
        "OomScoreAdj": {
          "description": "An integer value containing the score given to the container in\norder to tune OOM killer preferences.\n",
          "example": 500,
          "type": "integer"
        },
        "PidMode": {
          "description": "Set the PID (Process) Namespace mode for the container. It can be\neither:\n\n- `\"container:\u003cname|id\u003e\"`: joins another container's PID namespace\n- `\"host\"`: use the host's PID namespace inside the container\n",
          "type": "string"
        },
        "PortBindings": {
          "$ref": "#/components/schemas/PortMap"
        },
        "Privileged": {
          "description": "Gives the container full access to the host.",
          "type": "boolean"
        },
        "PublishAllPorts": {
          "description": "Allocates an ephemeral host port for all of a container's\nexposed ports.\n\nPorts are de-allocated when the container stops and allocated when\nthe container starts. The allocated port might be changed when\nrestarting the container.\n\nThe port is selected from the ephemeral port range that depends on\nthe kernel. For example, on Linux the range is defined by\n`/proc/sys/net/ipv4/ip_local_port_range`.\n",
          "type": "boolean"
        },
        "ReadonlyPaths": {
          "description": "The list of paths to be set as read-only inside the container\n(this overrides the default set of paths).\n",
          "example": [
            "/proc/bus",
            "/proc/fs",
            "/proc/irq",
            "/proc/sys",
            "/proc/sysrq-trigger"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "ReadonlyRootfs": {
          "description": "Mount the container's root filesystem as read only.",
          "type": "boolean"
        },
        "RestartPolicy": {
          "$ref": "#/components/schemas/RestartPolicy"
        },
        "Runtime": {
          "description": "Runtime to use with this container.",
          "type": "string",
          "x-nullable": true
        },
        "SecurityOpt": {
          "description": "A list of string values to customize labels for MLS systems, such\nas SELinux.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "ShmSize": {
          "description": "Size of `/dev/shm` in bytes. If omitted, the system uses 64MB.\n",
          "format": "int64",
          "minimum": 0,
          "type": "integer"
        },
        "StorageOpt": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Storage driver options for this container, in the form `{\"size\": \"120G\"}`.\n",
          "type": "object"
        },
        "Sysctls": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "A list of kernel parameters (sysctls) to set in the container.\n\nThis field is omitted if not set.",
          "example": {
            "net.ipv4.ip_forward": "1"
          },
          "type": "object",
          "x-nullable": true
        },
        "Tmpfs": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "A map of container directories which should be replaced by tmpfs\nmounts, and their corresponding mount options. For example:\n\n```\n{ \"/run\": \"rw,noexec,nosuid,size=65536k\" }\n```\n",
          "type": "object"
        },
        "UTSMode": {
          "description": "UTS namespace to use for the container.",
          "type": "string"
        },
        "Umask": {
          "description": "Set the initial umask for a Unix container.\n\nIf omitted, the daemon does not set a umask in the OCI process\nspecification, and the runtime's default behavior applies.\n\nJSON integers are decimal. For example, use `18` for the octal\numask `0022`, and `511` for the octal umask `0777`.",
          "format": "uint32",
          "type": "integer",
          "x-nullable": true
        },
        "UsernsMode": {
          "description": "Sets the usernamespace mode for the container when usernamespace\nremapping option is enabled.\n",
          "type": "string"
        },
        "VolumeDriver": {
          "description": "Driver that this container uses to mount volumes.",
          "type": "string"
        },
        "VolumesFrom": {
          "description": "A list of volumes to inherit from another container, specified in\nthe form `\u003ccontainer name\u003e[:\u003cro|rw\u003e]`.\n",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  ],
  "description": "Container configuration that depends on the host we are running on"
}
```



