bonus-edge-proxy/.devcontainer/devcontainer.json

53 lines
1.7 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"name": "Edge Proxy Dev Environment",
// 1. 指定要使用的 Docker 镜像
// 将 "your-dev-image:latest" 替换成你 docker build 时使用的实际镜像名
"image": "edge-proxy-edge-proxy-dev:latest",
// 2. 设置容器内的工作区挂载点
// 这告诉 VSCode当它连接到容器后应该打开哪个目录
"workspaceFolder": "/app",
// 3. (核心) 指定连接时使用的远程用户
// =================================================================
// !!! 关键步骤 !!!
// 你和同事需要在这里设置各自的用户名
// 你的文件里应该写: "remoteUser": "gyk"
// 你同事的文件里应该写: "remoteUser": "zql"
// =================================================================
"remoteUser": "gyk",
"mounts": [
"source=${localWorkspaceFolder},target=/app,type=bind,consistency=cached"
],
// 4. 定义 VS Code 设置和插件
"customizations": {
"vscode": {
// 推荐安装的插件,它们会被自动安装到容器里
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-vscode.makefile-tools",
"cheshirekow.cmake-format"
],
// 可以在这里覆盖 VS Code 的默认设置
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
},
// 5. (可选) 保持容器在后台持续运行
// 使用这个命令可以防止容器在 VSCode 关闭后就停止
"postCreateCommand": "sleep infinity",
// 6. 指定传递给 `docker run` 的参数
"runArgs": [
// 如果你需要使用 gdb 调试,这个参数是必须的
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
]
}