Repository navigation
Expand file tree
/
Copy pathdevcontainer.json
More file actions
91 lines (77 loc) 路 3.06 KB
/
Copy pathdevcontainer.json
File metadata and controls
91 lines (77 loc) 路 3.06 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
// For quick reference: https://containers.dev/implementors/json_reference/
"name": "Pytorch GPU",
"image": "nvcr.io/nvidia/pytorch:23.07-py3",
//"build": {
// "context": "..",
// "dockerfile": "Dockerfile"
//},
// 1. Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": []
// 2. Use 'mounts' to make a list of local directories available inside the container. More info: https://code.visualstudio.com/remote/advancedcontainers/add-local-file-mount
// "mounts": [],
// 3. Use 'runArgs' to pass arguments to the container.
// run the container with all GPUs
"runArgs": [
"--gpus",
"all"
],
// 4. Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
"features": {
// ZSH without OMZ
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"configureZshAsDefaultShell": "false",
"installOhMyZsh": "false",
"installOhMyZshConfig": "false",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
// Python with uv, Ruff, Mypy, MonkeyType and Bandit, installed using pipx
"ghcr.io/devcontainers/features/python:1": {
"installTools": "true",
"toolsToInstall": "ruff"
},
// git
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided",
"ppa": "false"
},
"ghcr.io/jsburckhardt/devcontainer-features/ruff:1": {}
},
// 5. Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/bin/python"
},
// installs useful extensions
"extensions": [
"ms-python.python",
"ms-python.debugpy",
"charliermarsh.ruff"
]
}
},
// 6. Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
// the following commands are related to container lifecylce. More info: https://containers.dev/implementors/json_reference/#lifecycle-scripts
// 7. Use 'initializeCommand' to run commands ON THE HOST before container is created or started.
// "initializeCommand": "",
// 8. Use 'onCreateCommand' to run commands INSIDE THE CONTAINER after it started for the first time.
// for the nvida containers, sh points to sh-wrap. We want it to point to dash
// https://wiki.debian.org/Shell
"onCreateCommand": "sudo ln -sf /usr/bin/dash /usr/bin/sh"
// 9. Use 'updateContentCommand' to run commands if the root filetree have any changes, during container creation.
// "updateContentCommand": "",
// 10. Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",
// 11. Use 'postStartCommand' to run a command each time the container starts successfully.
// "postStartCommand": "",
// 12. Use 'postAttachCommand' to run a command each time a tool attaches to the container successfully.
// "postAttachCommand": "",
}