Description
Required by coder/coder#16424
Given a running devcontainer, provide the ability for the agent to recreate the devcontainer.
Here is the sample invocation of recreating a devcontainer as performed by the VSCode Devcontainer plugin:
[132 ms] Start: Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/cian/.vscode/extensions/ms-vscode-remote.remote-containers-0.401.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/cian/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-db406014-703e-46ab-b72f-1496ba8685ac1741616579267 --workspace-folder /Users/cian/src/coder/envbuilder-starter-devcontainer --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/cian/src/coder/envbuilder-starter-devcontainer --id-label devcontainer.config_file=/Users/cian/src/coder/envbuilder-starter-devcontainer/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/cian/src/coder/envbuilder-starter-devcontainer/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --build-no-cache --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
Things to note:
- The
devcontainer-cli
really needs--id-label
in conjunction with--remove-existing-container
in order for it to know which container to delete. - It's not immediately clear which of the above options are always needed, which are specified inside the
devcontainer.json
(for example,userEnvProbe
can be specified in devcontainer.json), and which we need to figure out on the fly.