devcontainer.json base Schema
Base Dev Container
Defines a dev container
Type: object(?)
Definitions
devContainerCommon
No description provided for this model.
Type: object
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
$schema | string | Format: uri | The JSON schema of the devcontainer.json file. | ||||
name | string | string | A name for the dev container which can be displayed to the user. | ||||
features | object | object | Features to add to the dev container. | ||||
overrideFeatureInstallOrder | array | string | Array consisting of the Feature id (without the semantic version) of Features in the order the user wants them to be installed. | ||||
secrets | object | object | Recommended secrets for this dev container. Recommendations are provided as environment variable keys with optional metadata. | ||||
forwardPorts | array | 0 <= x <= 65535 or ^([a-z0-9-]+):(\d{1,5})$ | 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 ”. | ||||
portsAttributes | object | object | |||||
otherPortsAttributes | object | object | |||||
updateRemoteUserUID | boolean | boolean | 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. | ||||
containerEnv | object | object | Container environment variables. | ||||
containerUser | string | string | The user the container will be started with. The default is the user on the Docker image. | ||||
mounts | array | Mount and/or string | Mount points to set up when creating the container. See Docker’s documentation for the —mount option for the supported syntax. | ||||
init | boolean | boolean | Passes the —init flag when creating the dev container. | ||||
privileged | boolean | boolean | Passes the —privileged flag when creating the dev container. | ||||
capAdd | array | string | Passes docker capabilities to include when creating the dev container. | SYS_PTRACE | |||
securityOpt | array | string | Passes docker security options to include when creating the dev container. | seccomp=unconfined | |||
remoteEnv | object | object | Remote environment variables to set for processes spawned in the container including lifecycle scripts and any remote editor/IDE server process. | ||||
remoteUser | string | string | 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 | ['string', 'array', 'object'] | string | A command to run locally (i.e Your host machine, cloud VM) 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. If this is an object, each provided command will be run in parallel. | ||||
onCreateCommand | ['string', 'array', 'object'] | string | 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. If this is an object, each provided command will be run in parallel. | ||||
updateContentCommand | ['string', 'array', 'object'] | string | 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. If this is an object, each provided command will be run in parallel. | ||||
postCreateCommand | ['string', 'array', 'object'] | string | 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. If this is an object, each provided command will be run in parallel. | ||||
postStartCommand | ['string', 'array', 'object'] | string | 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. If this is an object, each provided command will be run in parallel. | ||||
postAttachCommand | ['string', 'array', 'object'] | string | 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. If this is an object, each provided command will be run in parallel. | ||||
waitFor | string | initializeCommand onCreateCommand updateContentCommand postCreateCommand postStartCommand | The user command to wait for before continuing execution in the background while the UI is starting up. The default is “updateContentCommand”. | ||||
userEnvProbe | string | none loginShell loginInteractiveShell interactiveShell | User environment probe to run. The default is “loginInteractiveShell”. | ||||
hostRequirements | object | object | Host hardware requirements. | ||||
customizations | object | object | Tool-specific configuration. Each tool should use a JSON object subproperty with a unique name to group its customizations. | ||||
additionalProperties | object | object |
nonComposeBase
No description provided for this model.
Type: object
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
appPort | ['integer', 'string', 'array'] | [‘integer’, ‘string’] | 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”. | ||||
runArgs | array | string | The arguments required when starting in the container. | ||||
shutdownAction | string | none stopContainer | Action to take when the user disconnects from the container in their editor. The default is to stop the container. | ||||
overrideCommand | boolean | boolean | Whether to overwrite the command specified in the image. The default is true. | ||||
workspaceFolder | string | string | The path of the workspace folder inside the container. | ||||
workspaceMount | string | string | The —mount parameter for docker run. The default is to mount the project folder at /workspaces/$project. |
dockerfileContainer
No description provided for this model.
Type: object(?)
buildOptions
No description provided for this model.
Type: object
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
target | string | string | Target stage in a multi-stage build. | ||||
args | object | object | Build arguments. | ||||
cacheFrom | ['string', 'array'] | string | The image to consider as a cache. Use an array to specify multiple images. | ||||
options | array | string | Additional arguments passed to the build command. |
imageContainer
No description provided for this model.
Type: object
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
image | string | ✅ | string | The docker image that will be used to create the container. |
composeContainer
No description provided for this model.
Type: object
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
dockerComposeFile | ['string', 'array'] | ✅ | string | The name of the docker-compose file(s) used to start the services. | |||
service | string | ✅ | string | The service you want to work on. This is considered the primary container for your dev environment which your editor will connect to. | |||
workspaceFolder | string | ✅ | string | The path of the workspace folder inside the container. This is typically the target path of a volume mount in the docker-compose.yml. | |||
runServices | array | string | An array of services that should be started and stopped. | ||||
shutdownAction | string | none stopCompose | 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 | boolean | boolean | Whether to overwrite the command specified in the image. The default is false. |
Mount
No description provided for this model.
Type: object
⚠️ Additional properties are not allowed.
Property | Type | Required | Possible values | Deprecated | Default | Description | Examples |
---|---|---|---|---|---|---|---|
type | string | ✅ | bind volume | Mount type. | |||
target | string | ✅ | string | Mount target. | |||
source | string | string | Mount source. |