-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevcontainer.json
More file actions
54 lines (47 loc) · 1.51 KB
/
devcontainer.json
File metadata and controls
54 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
"name": "C++ DevContainer",
"image": "cpp-dev:latest",
// Build image before starting container
"initializeCommand": "bash ${localWorkspaceFolder}/scripts/docker/build_image.sh",
// Pass host UID/GID to container for runtime remapping
"containerEnv": {
"HOST_UID": "${localEnv:UID}",
"HOST_GID": "${localEnv:GID}"
},
// Start container as root to allow entrypoint to remap UID/GID
"containerUser": "root",
// VS Code will connect as ubuntu user (with remapped UID/GID)
"remoteUser": "ubuntu",
// IMPORTANT: Prevent VS Code from creating a derived "vsc-...-uid" image
// We handle UID/GID remapping at runtime via our ENTRYPOINT script
"updateRemoteUserUID": false,
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "bash",
"editor.formatOnSave": true,
"C_Cpp.clang_format_style": "file",
"C_Cpp.default.cppStandard": "c++17"
},
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
},
"postCreateCommand": "./scripts/install-hooks.sh",
"postStartCommand": "bash",
// Clean container name and setup
"runArgs": [
"--rm",
"--hostname", "cpp-devcontainer",
"--name", "cpp-dev-${localEnv:USER}",
"--env", "DISPLAY=${localEnv:DISPLAY}",
"--env", "TERM=xterm-256color",
"--volume", "/tmp/.X11-unix:/tmp/.X11-unix",
"--gpus", "all"
// TODO: Analyze if needed
// "--cap-add=SYS_PTRACE",
// "--security-opt", "seccomp=unconfined"
]
}