1+ // For format details, see https://aka.ms/devcontainer.json
2+ {
3+ "name" : " Python 3 Developer Container" ,
4+ "build" : {
5+ "dockerfile" : " Dockerfile" ,
6+ "target" : " build" ,
7+ "context" : " ." ,
8+ "args" : {}
9+ },
10+ "remoteEnv" : {
11+ "DISPLAY" : " ${localEnv:DISPLAY}"
12+ },
13+ // Set *default* container specific settings.json values on container create.
14+ "settings" : {
15+ "python.defaultInterpreterPath" : " /usr/local/bin/python" ,
16+ "python.linting.enabled" : true
17+ },
18+ // Add the IDs of extensions you want installed when the container is created.
19+ "extensions" : [
20+ " ms-python.python" ,
21+ " ms-python.vscode-pylance"
22+ ],
23+ // Make sure the files we are mapping into the container exist on the host
24+ "initializeCommand" : " bash -c 'for i in $HOME/.inputrc $HOME/.bashrc_dev; do [ -f $i ] || touch $i; done'" ,
25+ "runArgs" : [
26+ " --privileged" ,
27+ " --net=host" ,
28+ " -v=${localEnv:HOME}/.ssh:/root/.ssh" ,
29+ " -v=${localEnv:HOME}/.bashrc_dev:/root/.bashrc" ,
30+ " -v=${localEnv:HOME}/.inputrc:/root/.inputrc"
31+ ],
32+ "mounts" : [
33+ // map in home directory - not strictly necessary but useful
34+ " source=${localEnv:HOME},target=${localEnv:HOME},type=bind,consistency=cached"
35+ ],
36+ // make the workspace folder the same inside and outside of the container
37+ "workspaceMount" : " source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind" ,
38+ "workspaceFolder" : " ${localWorkspaceFolder}" ,
39+ // After the container is created, install the python project in editable form
40+ "postCreateCommand" : " pip install $([ -f requirements_dev.txt ] && echo -r requirements_dev.txt ) -e .[dev]"
41+ }
0 commit comments