About 10 mins after asking this question I thought of a different approach which is perhaps still a hack, but it avoids having to use the project directory name. I put the VSIX file in the .devcontainer/ directory, and then added a COPY command to the end of my Dockerfile thus:
COPY vscode-cds-1.1.4.vsix /tmp/
and could then specify this neutral path in the extensions property thus:
"extensions": [
"dbaeumer.vscode-eslint",
"/tmp/vscode-cds-1.1.4.vsix"
]
This works. Wondering if there's a better way though.
Answer from qmacro on Stack OverflowAbout 10 mins after asking this question I thought of a different approach which is perhaps still a hack, but it avoids having to use the project directory name. I put the VSIX file in the .devcontainer/ directory, and then added a COPY command to the end of my Dockerfile thus:
COPY vscode-cds-1.1.4.vsix /tmp/
and could then specify this neutral path in the extensions property thus:
"extensions": [
"dbaeumer.vscode-eslint",
"/tmp/vscode-cds-1.1.4.vsix"
]
This works. Wondering if there's a better way though.
devcontainer.json has access to the following variables:
https://containers.dev/implementors/json_reference/#variables-in-devcontainerjson
So in your example it would be:
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"${containerWorkspaceFolder}/vscode-cds-1.1.4.vsix"
]
}
}
Additional variable support was added in this PR