From 889b02572bde22452752c6019303c1cfdf4241fc Mon Sep 17 00:00:00 2001 From: GuanYuankai Date: Sat, 11 Oct 2025 14:16:34 +0800 Subject: [PATCH] Feat: Create separate devcontainer configs for each user --- .devcontainer/devcontainer.gyk.json | 22 ++++++++++++ .devcontainer/devcontainer.json | 53 ----------------------------- .devcontainer/devcontainer.zql.json | 22 ++++++++++++ 3 files changed, 44 insertions(+), 53 deletions(-) create mode 100644 .devcontainer/devcontainer.gyk.json delete mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/devcontainer.zql.json diff --git a/.devcontainer/devcontainer.gyk.json b/.devcontainer/devcontainer.gyk.json new file mode 100644 index 0000000..fdd232e --- /dev/null +++ b/.devcontainer/devcontainer.gyk.json @@ -0,0 +1,22 @@ +{ + "name": "Edge Proxy Dev (gyk)", + "image": "edge-proxy-edge-proxy-dev:latest", + "workspaceFolder": "/app", + "remoteUser": "gyk", + "mounts": [ + "source=${localWorkspaceFolder},target=/app,type=bind,consistency=cached" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools" + ] + } + }, + "postCreateCommand": "sleep infinity", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", "seccomp=unconfined" + ] +} \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index c5c0328..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "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" - ] -} \ No newline at end of file diff --git a/.devcontainer/devcontainer.zql.json b/.devcontainer/devcontainer.zql.json new file mode 100644 index 0000000..422a900 --- /dev/null +++ b/.devcontainer/devcontainer.zql.json @@ -0,0 +1,22 @@ +{ + "name": "Edge Proxy Dev (zql)", + "image": "edge-proxy-edge-proxy-dev:latest", + "workspaceFolder": "/app", + "remoteUser": "zql", + "mounts": [ + "source=${localWorkspaceFolder},target=/app,type=bind,consistency=cached" + ], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools" + ] + } + }, + "postCreateCommand": "sleep infinity", + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", "seccomp=unconfined" + ] +} \ No newline at end of file