我似乎找不到明确的答案,我找到了/sf/answers/4820489271/但它不是很清楚,也可能已经过时,因为“dockerComposeFile”不再是有效的选项。
我有一个项目,其中包含一个现有的 docker-compose.yml 文件,该文件启动 MariaDB 数据库,我为 Node 添加了一个生成的 devcontainer.json 配置文件,如下所示
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.202.3/containers/javascript-node
{
"name": "Node.js",
"runArgs": ["--init"],
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 16, 14, 12.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local arm64/Apple Silicon.
"args": { "VARIANT": "12" }
},
// Set *default* container specific settings.json values on …Run Code Online (Sandbox Code Playgroud) docker docker-compose visual-studio-code vscode-remote vscode-devcontainer