diff --git a/_implementors/features.md b/_implementors/features.md
index 229c11aa..ef2536e1 100644
--- a/_implementors/features.md
+++ b/_implementors/features.md
@@ -66,7 +66,7 @@ Options
## devcontainer.json properties
-Features are referenced in a user's [`devcontainer.json`](devcontainer-reference#devcontainerjson) under the top level `features` object.
+Features are referenced in a user's [`devcontainer.json`](../json_reference) under the top level `features` object.
A user can specify an arbitrary number of features. At build time, these features will be installed in an order defined by a combination of the [installation order rules and implementation](#Installation-Order).
@@ -269,4 +269,4 @@ There are several things to keep in mind for an application that implements feat
- Parameters like `privileged`, `init` are included if just 1 feature requires them.
- Parameters like `capAdd`, `securityOp` are concatenated.
- `containerEnv` is added before the feature is executed as `ENV` commands in the Dockerfile.
-- Each feature script executes as its own layer to aid in caching and rebuilding.
\ No newline at end of file
+- Each feature script executes as its own layer to aid in caching and rebuilding.
diff --git a/_implementors/json_schema.md b/_implementors/json_schema.md
index 82894453..7a3ca0c9 100644
--- a/_implementors/json_schema.md
+++ b/_implementors/json_schema.md
@@ -6,605 +6,583 @@ author: Microsoft
index: 3
---
-You may review the [current devcontainer.json schema](https://github.com/microsoft/vscode/blob/main/extensions/configuration-editing/schemas/devContainer.schema.src.json), and the accompanying [dev-container-spec repo issue](https://github.com/microsoft/dev-container-spec/issues/14).
+You may review the current devcontainer.json schemas in the spec repo, which include:
+* The [base schema](https://github.com/devcontainers/spec/blob/main/schemas/devContainer.base.schema.json): schema describing all base properties as documented in the [devcontainer.json reference](../json_reference).
+* The [main schema](https://github.com/devcontainers/spec/blob/main/schemas/devContainer.schema.json): references the base schema, plus all schemas containing tool-specific properties.
+
+## Base Schema
```json
{
-"$schema": "http://json-schema.org/draft-07/schema#",
-"description": "Defines a dev container",
-"allowComments": true,
-"allowTrailingCommas": true,
-"definitions": {
- "devContainerCommon": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "A name for the dev container displayed in the UI."
- },
- "extensions": {
- "type": "array",
- "description": "An array of extensions that should be installed into the container.",
- "items": {
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "description": "Defines a dev container",
+ "allowComments": true,
+ "allowTrailingCommas": false,
+ "definitions": {
+ "devContainerCommon": {
+ "type": "object",
+ "properties": {
+ "name": {
"type": "string",
- "pattern": "^([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)(@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?$",
- "errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
- }
- },
- "settings": {
- "$ref": "vscode://schemas/settings/machine",
- "description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again."
- },
- "features": {
- "type": "object",
- "description": "Features to add to the dev container.",
- "additionalProperties": true
- },
- "forwardPorts": {
- "type": "array",
- "description": "Ports that are forwarded from the container to the local machine. Can be an integer port number, or a string of the format \"host:port_number\".",
- "items": {
- "oneOf": [
- {
- "type": "integer",
- "maximum": 65535,
- "minimum": 0
- },
- {
- "type": "string",
- "pattern": "^([a-z0-9-]+):(\\d{1,5})$"
- }
- ]
- }
- },
- "portsAttributes": {
- "type": "object",
- "patternProperties": {
- "(^\\d+(-\\d+)?$)|(.+)": {
- "type": "object",
- "description": "A port, range of ports (ex. \"40000-55000\"), or regular expression (ex. \".+\\\\/server.js\"). For a port number or range, the attributes will apply to that port number or range of port numbers. Attributes which use a regular expression will apply to ports whose associated process command line matches the expression.",
- "properties": {
- "onAutoForward": {
- "type": "string",
- "enum": [
- "notify",
- "openBrowser",
- "openBrowserOnce",
- "openPreview",
- "silent",
- "ignore"
- ],
- "enumDescriptions": [
- "Shows a notification when a port is automatically forwarded.",
- "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
- "Opens the browser when the port is automatically forwarded, but only the first time the port is forward during a session. Depending on your settings, this could open an embedded browser.",
- "Opens a preview in the same window when the port is automatically forwarded.",
- "Shows no notification and takes no action when this port is automatically forwarded.",
- "This port will not be automatically forwarded."
- ],
- "description": "Defines the action that occurs when the port is discovered for automatic forwarding",
- "default": "notify"
- },
- "elevateIfNeeded": {
- "type": "boolean",
- "description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
- "default": false
- },
- "label": {
- "type": "string",
- "description": "Label that will be shown in the UI for this port.",
- "default": "Application"
- },
- "requireLocalPort": {
- "type": "boolean",
- "markdownDescription": "When true, a modal dialog will show if the chosen local port isn't used for forwarding.",
- "default": false
+ "description": "A name for the dev container which can be displayed to the user."
+ },
+ "features": {
+ "type": "object",
+ "description": "Features to add to the dev container.",
+ "additionalProperties": true
+ },
+ "forwardPorts": {
+ "type": "array",
+ "description": "Ports that are forwarded from the container to the local machine. Can be an integer port number, or a string of the format \"host:port_number\".",
+ "items": {
+ "oneOf": [
+ {
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
},
- "protocol": {
+ {
"type": "string",
- "enum": [
- "http",
- "https"
- ],
- "description": "The protocol to use when forwarding this port."
+ "pattern": "^([a-z0-9-]+):(\\d{1,5})$"
}
- },
- "default": {
- "label": "Application",
- "onAutoForward": "notify"
- }
+ ]
}
},
- "markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Application\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n},\n\".+\\\\/server.js\": {\n \"onAutoForward\": \"openPreview\"\n}\n```",
- "defaultSnippets": [
- {
- "body": {
- "${1:3000}": {
- "label": "${2:Application}",
+ "portsAttributes": {
+ "type": "object",
+ "patternProperties": {
+ "(^\\d+(-\\d+)?$)|(.+)": {
+ "type": "object",
+ "description": "A port, range of ports (ex. \"40000-55000\"), or regular expression (ex. \".+\\\\/server.js\"). For a port number or range, the attributes will apply to that port number or range of port numbers. Attributes which use a regular expression will apply to ports whose associated process command line matches the expression.",
+ "properties": {
+ "onAutoForward": {
+ "type": "string",
+ "enum": [
+ "notify",
+ "openBrowser",
+ "openBrowserOnce",
+ "openPreview",
+ "silent",
+ "ignore"
+ ],
+ "enumDescriptions": [
+ "Shows a notification when a port is automatically forwarded.",
+ "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
+ "Opens the browser when the port is automatically forwarded, but only the first time the port is forward during a session. Depending on your settings, this could open an embedded browser.",
+ "Opens a preview in the same window when the port is automatically forwarded.",
+ "Shows no notification and takes no action when this port is automatically forwarded.",
+ "This port will not be automatically forwarded."
+ ],
+ "description": "Defines the action that occurs when the port is discovered for automatic forwarding",
+ "default": "notify"
+ },
+ "elevateIfNeeded": {
+ "type": "boolean",
+ "description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
+ "default": false
+ },
+ "label": {
+ "type": "string",
+ "description": "Label that will be shown in the UI for this port.",
+ "default": "Application"
+ },
+ "requireLocalPort": {
+ "type": "boolean",
+ "markdownDescription": "When true, a modal dialog will show if the chosen local port isn't used for forwarding.",
+ "default": false
+ },
+ "protocol": {
+ "type": "string",
+ "enum": [
+ "http",
+ "https"
+ ],
+ "description": "The protocol to use when forwarding this port."
+ }
+ },
+ "default": {
+ "label": "Application",
"onAutoForward": "notify"
}
}
- }
- ],
- "additionalProperties": false
- },
- "otherPortsAttributes": {
- "type": "object",
- "properties": {
- "onAutoForward": {
- "type": "string",
- "enum": [
- "notify",
- "openBrowser",
- "openPreview",
- "silent",
- "ignore"
- ],
- "enumDescriptions": [
- "Shows a notification when a port is automatically forwarded.",
- "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
- "Opens a preview in the same window when the port is automatically forwarded.",
- "Shows no notification and takes no action when this port is automatically forwarded.",
- "This port will not be automatically forwarded."
- ],
- "description": "Defines the action that occurs when the port is discovered for automatic forwarding",
- "default": "notify"
},
- "elevateIfNeeded": {
- "type": "boolean",
- "description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
- "default": false
- },
- "label": {
- "type": "string",
- "description": "Label that will be shown in the UI for this port.",
- "default": "Application"
+ "markdownDescription": "Set default properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Application\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n},\n\".+\\\\/server.js\": {\n \"onAutoForward\": \"openPreview\"\n}\n```",
+ "defaultSnippets": [
+ {
+ "body": {
+ "${1:3000}": {
+ "label": "${2:Application}",
+ "onAutoForward": "notify"
+ }
+ }
+ }
+ ],
+ "additionalProperties": false
+ },
+ "otherPortsAttributes": {
+ "type": "object",
+ "properties": {
+ "onAutoForward": {
+ "type": "string",
+ "enum": [
+ "notify",
+ "openBrowser",
+ "openPreview",
+ "silent",
+ "ignore"
+ ],
+ "enumDescriptions": [
+ "Shows a notification when a port is automatically forwarded.",
+ "Opens the browser when the port is automatically forwarded. Depending on your settings, this could open an embedded browser.",
+ "Opens a preview in the same window when the port is automatically forwarded.",
+ "Shows no notification and takes no action when this port is automatically forwarded.",
+ "This port will not be automatically forwarded."
+ ],
+ "description": "Defines the action that occurs when the port is discovered for automatic forwarding",
+ "default": "notify"
+ },
+ "elevateIfNeeded": {
+ "type": "boolean",
+ "description": "Automatically prompt for elevation (if needed) when this port is forwarded. Elevate is required if the local port is a privileged port.",
+ "default": false
+ },
+ "label": {
+ "type": "string",
+ "description": "Label that will be shown in the UI for this port.",
+ "default": "Application"
+ },
+ "requireLocalPort": {
+ "type": "boolean",
+ "markdownDescription": "When true, a modal dialog will show if the chosen local port isn't used for forwarding.",
+ "default": false
+ },
+ "protocol": {
+ "type": "string",
+ "enum": [
+ "http",
+ "https"
+ ],
+ "description": "The protocol to use when forwarding this port."
+ }
},
- "requireLocalPort": {
- "type": "boolean",
- "markdownDescription": "When true, a modal dialog will show if the chosen local port isn't used for forwarding.",
- "default": false
+ "defaultSnippets": [
+ {
+ "body": {
+ "onAutoForward": "ignore"
+ }
+ }
+ ],
+ "markdownDescription": "Set default properties that are applied to all ports that don't get properties from the setting `remote.portsAttributes`. For example:\n\n```\n{\n \"onAutoForward\": \"ignore\"\n}\n```",
+ "additionalProperties": false
+ },
+ "updateRemoteUserUID": {
+ "type": "boolean",
+ "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder."
+ },
+ "remoteEnv": {
+ "type": "object",
+ "additionalProperties": {
+ "type": [
+ "string",
+ "null"
+ ]
},
- "protocol": {
- "type": "string",
- "enum": [
- "http",
- "https"
- ],
- "description": "The protocol to use when forwarding this port."
+ "description": "Remote environment variables to set for processes spawned in the container including lifecycle scripts and any remote editor/IDE server process."
+ },
+ "remoteUser": {
+ "type": "string",
+ "description": "The username to use for spawning processes in the container including lifecycle scripts and any remote editor/IDE server process. The default is the same user as the container."
+ },
+ "initializeCommand": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "A command to run locally before anything else. This command is run before \"onCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
}
},
- "defaultSnippets": [
- {
- "body": {
- "onAutoForward": "ignore"
- }
+ "onCreateCommand": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
}
- ],
- "markdownDescription": "Set default properties that are applied to all ports that don't get properties from the setting `remote.portsAttributes`. For example:\n\n```\n{\n \"onAutoForward\": \"ignore\"\n}\n```",
- "additionalProperties": false
- },
- "updateRemoteUserUID": {
- "type": "boolean",
- "description": "Controls whether on Linux the container's user should be updated with the local user's UID and GID. On by default when opening from a local folder."
- },
- "remoteEnv": {
- "type": "object",
- "additionalProperties": {
+ },
+ "updateContentCommand": {
"type": [
"string",
- "null"
- ]
+ "array"
+ ],
+ "description": "A command to run when creating the container and rerun when the workspace content was updated while creating the container. This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
+ }
},
- "description": "Remote environment variables. If these are used in the Integrated Terminal, make sure the 'Terminal > Integrated: Inherit Env' setting is enabled."
- },
- "remoteUser": {
- "type": "string",
- "description": "The user VS Code Server will be started with. The default is the same user as the container."
- },
- "initializeCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run locally before anything else. This command is run before \"onCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "onCreateCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run when creating the container. This command is run after \"initializeCommand\" and before \"updateContentCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "updateContentCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run when creating the container and rerun when the workspace content was updated while creating the container. This command is run after \"onCreateCommand\" and before \"postCreateCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "postCreateCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "postStartCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "postAttachCommand": {
- "type": [
- "string",
- "array"
- ],
- "description": "A command to run when attaching to the container. This command is run after \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
- "items": {
- "type": "string"
- }
- },
- "waitFor": {
- "type": "string",
- "enum": [
- "initializeCommand",
- "onCreateCommand",
- "updateContentCommand",
- "postCreateCommand",
- "postStartCommand"
- ],
- "description": "The user command to wait for before continuing execution in the background while the UI is starting up. The default is \"updateContentCommand\"."
- },
- "devPort": {
- "type": "integer",
- "description": "The port VS Code can use to connect to its backend."
- },
- "userEnvProbe": {
- "type": "string",
- "enum": [
- "none",
- "loginShell",
- "loginInteractiveShell",
- "interactiveShell"
- ],
- "description": "User environment probe to run. The default is \"loginInteractiveShell\"."
- },
- "codespaces": {
- "type": "object",
- "additionalProperties": true,
- "description": "Codespaces-specific configuration."
- },
- "hostRequirements": {
- "type": "object",
- "description": "Host hardware requirements.",
- "allOf": [
- {
- "type": "object",
- "properties": {
- "cpus": {
- "type": "integer",
- "minimum": 1,
- "description": "Number of required CPUs."
- },
- "memory": {
- "type": "string",
- "pattern": "^\\d+([tgmk]b)?$",
- "description": "Amount of required RAM in bytes. Supports units tb, gb, mb and kb."
- },
- "storage": {
- "type": "string",
- "pattern": "^\\d+([tgmk]b)?$",
- "description": "Amount of required disk space in bytes. Supports units tb, gb, mb and kb."
- }
- }
+ "postCreateCommand": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "A command to run after creating the container. This command is run after \"updateContentCommand\" and before \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
}
- ]
- },
- "vscode": {
- "type": "object",
- "properties": {
- "extensions": {
- "type": "array",
- "description": "An array of extensions that should be installed into the container.",
- "items": {
- "type": "string",
- "pattern": "^([a-z0-9A-Z][a-z0-9A-Z-]*)\\.([a-z0-9A-Z][a-z0-9A-Z-]*)(@(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)?$",
- "errorMessage": "Expected format: '${publisher}.${name}' or '${publisher}.${name}@${version}'. Example: 'ms-dotnettools.csharp'."
- }
- },
- "settings": {
- "$ref": "vscode://schemas/settings/machine",
- "description": "Machine specific settings that should be copied into the container. These are only copied when connecting to the container for the first time, rebuilding the container then triggers it again."
- },
- "devPort": {
- "type": "integer",
- "description": "The port VS Code can use to connect to its backend."
+ },
+ "postStartCommand": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "A command to run after starting the container. This command is run after \"postCreateCommand\" and before \"postAttachCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
}
- }
- },
- "customizations": {
- "type": "object",
+ },
+ "postAttachCommand": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "A command to run when attaching to the container. This command is run after \"postStartCommand\". If this is a single string, it will be run in a shell. If this is an array of strings, it will be run as a single command without shell.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "waitFor": {
+ "type": "string",
+ "enum": [
+ "initializeCommand",
+ "onCreateCommand",
+ "updateContentCommand",
+ "postCreateCommand",
+ "postStartCommand"
+ ],
+ "description": "The user command to wait for before continuing execution in the background while the UI is starting up. The default is \"updateContentCommand\"."
+ },
+ "userEnvProbe": {
+ "type": "string",
+ "enum": [
+ "none",
+ "loginShell",
+ "loginInteractiveShell",
+ "interactiveShell"
+ ],
+ "description": "User environment probe to run. The default is \"loginInteractiveShell\"."
+ },
+ "hostRequirements": {
+ "type": "object",
+ "description": "Host hardware requirements.",
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "cpus": {
+ "type": "integer",
+ "minimum": 1,
+ "description": "Number of required CPUs."
+ },
+ "memory": {
+ "type": "string",
+ "pattern": "^\\d+([tgmk]b)?$",
+ "description": "Amount of required RAM in bytes. Supports units tb, gb, mb and kb."
+ },
+ "storage": {
+ "type": "string",
+ "pattern": "^\\d+([tgmk]b)?$",
+ "description": "Amount of required disk space in bytes. Supports units tb, gb, mb and kb."
+ }
+ }
+ }
+ ]
+ },
+ "customizations": {
+ "type": "object",
+ "description": "Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations."
+ },
"additionalProperties": {
"type": "object",
"additionalProperties": true
- },
- "description": "Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations."
+ }
}
- }
- },
- "nonComposeBase": {
- "type": "object",
- "properties": {
- "appPort": {
- "type": [
- "integer",
- "string",
- "array"
- ],
- "description": "Application ports that are exposed by the container. This can be a single port or an array of ports. Each port can be a number or a string. A number is mapped to the same port on the host. A string is passed to Docker unchanged and can be used to map ports differently, e.g. \"8000:8010\".",
- "items": {
+ },
+ "nonComposeBase": {
+ "type": "object",
+ "properties": {
+ "appPort": {
"type": [
"integer",
- "string"
- ]
- }
- },
- "containerEnv": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
+ "string",
+ "array"
+ ],
+ "description": "Application ports that are exposed by the container. This can be a single port or an array of ports. Each port can be a number or a string. A number is mapped to the same port on the host. A string is passed to Docker unchanged and can be used to map ports differently, e.g. \"8000:8010\".",
+ "items": {
+ "type": [
+ "integer",
+ "string"
+ ]
+ }
},
- "description": "Container environment variables."
- },
- "containerUser": {
- "type": "string",
- "description": "The user the container will be started with. The default is the user on the Docker image."
- },
- "mounts": {
- "type": "array",
- "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.",
- "items": {
- "type": "string"
- }
- },
- "runArgs": {
- "type": "array",
- "description": "The arguments required when starting in the container.",
- "items": {
- "type": "string"
+ "containerEnv": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "description": "Container environment variables."
+ },
+ "containerUser": {
+ "type": "string",
+ "description": "The user the container will be started with. The default is the user on the Docker image."
+ },
+ "mounts": {
+ "type": "array",
+ "description": "Mount points to set up when creating the container. See Docker's documentation for the --mount option for the supported syntax.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "runArgs": {
+ "type": "array",
+ "description": "The arguments required when starting in the container.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "shutdownAction": {
+ "type": "string",
+ "enum": [
+ "none",
+ "stopContainer"
+ ],
+ "description": "Action to take when the user disconnects from the container in their editor. The default is to stop the container."
+ },
+ "overrideCommand": {
+ "type": "boolean",
+ "description": "Whether to overwrite the command specified in the image. The default is true."
+ },
+ "workspaceFolder": {
+ "type": "string",
+ "description": "The path of the workspace folder inside the container."
+ },
+ "workspaceMount": {
+ "type": "string",
+ "description": "The --mount parameter for docker run. The default is to mount the project folder at /workspaces/$project."
}
- },
- "shutdownAction": {
- "type": "string",
- "enum": [
- "none",
- "stopContainer"
- ],
- "description": "Action to take when the VS Code window is closed. The default is to stop the container."
- },
- "overrideCommand": {
- "type": "boolean",
- "description": "Whether to overwrite the command specified in the image. The default is true."
- },
- "workspaceFolder": {
- "type": "string",
- "description": "The path of the workspace folder inside the container."
- },
- "workspaceMount": {
- "type": "string",
- "description": "The --mount parameter for docker run. The default is to mount the project folder at /workspaces/$project."
}
- }
- },
- "dockerfileContainer": {
- "oneOf": [
- {
- "type": "object",
- "properties": {
- "build": {
- "type": "object",
- "description": "Docker build-related options.",
- "allOf": [
- {
- "type": "object",
- "properties": {
- "dockerfile": {
- "type": "string",
- "description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
+ },
+ "dockerfileContainer": {
+ "oneOf": [
+ {
+ "type": "object",
+ "properties": {
+ "build": {
+ "type": "object",
+ "description": "Docker build-related options.",
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "dockerfile": {
+ "type": "string",
+ "description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
+ },
+ "context": {
+ "type": "string",
+ "description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
+ }
},
- "context": {
- "type": "string",
- "description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
- }
+ "required": [
+ "dockerfile"
+ ]
},
- "required": [
- "dockerfile"
- ]
- },
- {
- "$ref": "#/definitions/buildOptions"
- }
- ]
- }
+ {
+ "$ref": "#/definitions/buildOptions"
+ }
+ ]
+ }
+ },
+ "required": [
+ "build"
+ ]
},
- "required": [
- "build"
- ]
- },
- {
- "allOf": [
- {
- "type": "object",
- "properties": {
- "dockerFile": {
- "type": "string",
- "description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
+ {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "dockerFile": {
+ "type": "string",
+ "description": "The location of the Dockerfile that defines the contents of the container. The path is relative to the folder containing the `devcontainer.json` file."
+ },
+ "context": {
+ "type": "string",
+ "description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
+ }
},
- "context": {
- "type": "string",
- "description": "The location of the context folder for building the Docker image. The path is relative to the folder containing the `devcontainer.json` file."
- }
+ "required": [
+ "dockerFile"
+ ]
},
- "required": [
- "dockerFile"
- ]
- },
- {
- "type": "object",
- "properties": {
- "build": {
- "description": "Docker build-related options.",
- "$ref": "#/definitions/buildOptions"
+ {
+ "type": "object",
+ "properties": {
+ "build": {
+ "description": "Docker build-related options.",
+ "$ref": "#/definitions/buildOptions"
+ }
}
}
- }
- ]
- }
- ]
- },
- "buildOptions": {
- "type": "object",
- "properties": {
- "target": {
- "type": "string",
- "description": "Target stage in a multi-stage build."
- },
- "args": {
- "type": "object",
- "additionalProperties": {
- "type": [
- "string"
]
+ }
+ ]
+ },
+ "buildOptions": {
+ "type": "object",
+ "properties": {
+ "target": {
+ "type": "string",
+ "description": "Target stage in a multi-stage build."
},
- "description": "Build arguments."
- },
- "cacheFrom": {
- "type": [
- "string",
- "array"
- ],
- "description": "The image to consider as a cache. Use an array to specify multiple images.",
- "items": {
- "type": "string"
+ "args": {
+ "type": "object",
+ "additionalProperties": {
+ "type": [
+ "string"
+ ]
+ },
+ "description": "Build arguments."
+ },
+ "cacheFrom": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "The image to consider as a cache. Use an array to specify multiple images.",
+ "items": {
+ "type": "string"
+ }
}
}
- }
- },
- "imageContainer": {
- "type": "object",
- "properties": {
- "image": {
- "type": "string",
- "description": "The docker image that will be used to create the container."
- }
},
- "required": [
- "image"
- ]
- },
- "composeContainer": {
- "type": "object",
- "properties": {
- "dockerComposeFile": {
- "type": [
- "string",
- "array"
- ],
- "description": "The name of the docker-compose file(s) used to start the services.",
- "items": {
- "type": "string"
- }
- },
- "service": {
- "type": "string",
- "description": "The service you want to work on."
- },
- "runServices": {
- "type": "array",
- "description": "An array of services that should be started and stopped.",
- "items": {
- "type": "string"
+ "imageContainer": {
+ "type": "object",
+ "properties": {
+ "image": {
+ "type": "string",
+ "description": "The docker image that will be used to create the container."
}
},
- "workspaceFolder": {
- "type": "string",
- "description": "The path of the workspace folder inside the container. This is typically the target path of a volume mount in the docker-compose.yml."
- },
- "shutdownAction": {
- "type": "string",
- "enum": [
- "none",
- "stopCompose"
- ],
- "description": "Action to take when the VS Code window is closed. The default is to stop the containers."
- },
- "overrideCommand": {
- "type": "boolean",
- "description": "Whether to overwrite the command specified in the image. The default is false."
- }
+ "required": [
+ "image"
+ ]
},
- "required": [
- "dockerComposeFile",
- "service",
- "workspaceFolder"
- ]
- }
-},
-"oneOf": [
- {
- "allOf": [
- {
- "oneOf": [
- {
- "allOf": [
- {
- "oneOf": [
- {
- "$ref": "#/definitions/dockerfileContainer"
- },
- {
- "$ref": "#/definitions/imageContainer"
- }
- ]
- },
- {
- "$ref": "#/definitions/nonComposeBase"
- }
- ]
- },
- {
- "$ref": "#/definitions/composeContainer"
+ "composeContainer": {
+ "type": "object",
+ "properties": {
+ "dockerComposeFile": {
+ "type": [
+ "string",
+ "array"
+ ],
+ "description": "The name of the docker-compose file(s) used to start the services.",
+ "items": {
+ "type": "string"
+ }
+ },
+ "service": {
+ "type": "string",
+ "description": "The service you want to work on. This is considered the primary container for your dev environment which your editor will connect to."
+ },
+ "runServices": {
+ "type": "array",
+ "description": "An array of services that should be started and stopped.",
+ "items": {
+ "type": "string"
}
- ]
+ },
+ "workspaceFolder": {
+ "type": "string",
+ "description": "The path of the workspace folder inside the container. This is typically the target path of a volume mount in the docker-compose.yml."
+ },
+ "shutdownAction": {
+ "type": "string",
+ "enum": [
+ "none",
+ "stopCompose"
+ ],
+ "description": "Action to take when the user disconnects from the primary container in their editor. The default is to stop all of the compose containers."
+ },
+ "overrideCommand": {
+ "type": "boolean",
+ "description": "Whether to overwrite the command specified in the image. The default is false."
+ }
},
- {
- "$ref": "#/definitions/devContainerCommon"
- }
- ]
+ "required": [
+ "dockerComposeFile",
+ "service",
+ "workspaceFolder"
+ ]
+ }
},
- {
- "type": "object",
- "$ref": "#/definitions/devContainerCommon",
- "additionalProperties": false
- }
-]
+ "oneOf": [
+ {
+ "allOf": [
+ {
+ "oneOf": [
+ {
+ "allOf": [
+ {
+ "oneOf": [
+ {
+ "$ref": "#/definitions/dockerfileContainer"
+ },
+ {
+ "$ref": "#/definitions/imageContainer"
+ }
+ ]
+ },
+ {
+ "$ref": "#/definitions/nonComposeBase"
+ }
+ ]
+ },
+ {
+ "$ref": "#/definitions/composeContainer"
+ }
+ ]
+ },
+ {
+ "$ref": "#/definitions/devContainerCommon"
+ }
+ ]
+ },
+ {
+ "type": "object",
+ "$ref": "#/definitions/devContainerCommon",
+ "additionalProperties": false
+ }
+ ]
+}
+```
+
+## Main Schema
+
+```json
+{
+ "allOf": [
+ {
+ "$ref": "./devContainer.base.schema.json"
+ },
+ {
+ "$ref": "https://raw.githubusercontent.com/microsoft/vscode/main/extensions/configuration-editing/schemas/devContainer.codespaces.schema.json"
+ },
+ {
+ "$ref": "https://raw.githubusercontent.com/microsoft/vscode/main/extensions/configuration-editing/schemas/devContainer.vscode.schema.json"
+ }
+ ]
}
-```
\ No newline at end of file
+```