Skip to main content

Module devcontainer

Module devcontainer 

Source
Expand description

What a workspace’s container is made from: its .devcontainer/devcontainer.json (or .devcontainer.json), else the default image.

Supported: image, build.dockerfile (+ build.context, build.args), containerEnv, remoteEnv, onCreateCommand and postCreateCommand (string, array or object; run once, as root, when the container is created). Everything else that changes the container — features, mounts, runArgs, forwardPorts, dockerComposeFile, workspaceMount/workspaceFolder, remoteUser/containerUser, the other lifecycle commands — is ignored, and the model is told which ones.

Structs§

Spec
How to make and use one workspace’s container.

Enums§

Cmd
A lifecycle command: a shell line or an argument list.
Image
The image to run.

Constants§

FILES
Where devcontainer.json may live, in order.

Functions§

find
The workspace’s devcontainer.json, if it has one.
strip_jsonc
JSON with comments (//, /* */) and trailing commas, as devcontainer.json allows, turned into plain JSON. Strings are left alone.
valid_image
An image reference: no options, spaces or shell characters.