Skip to content

Commit 2bd7ae5

Browse files
committed
更新DevContainer设置,增加Docker Start后对git proxy的设置
1 parent 16edcb7 commit 2bd7ae5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
]
1616
}
1717
},
18+
// Set *default* container specific shell values on container create.
19+
"settings": {
20+
"terminal.integrated.shell.linux": "/bin/bash"
21+
},
22+
23+
// Add the proxy settings to the container.
1824
"containerEnv": {
19-
"HTTP_PROXY": "http://host.docker.internal:7890",
20-
"HTTPS_PROXY": "http://host.docker.internal:7890",
2125
"http_proxy": "http://host.docker.internal:7890",
2226
"https_proxy": "http://host.docker.internal:7890"
2327
},
@@ -29,7 +33,10 @@
2933
"forwardPorts": [3000],
3034

3135
// Use 'postCreateCommand' to run commands after the container is created.
32-
"postCreateCommand": "npm install"
36+
"postCreateCommand": "npm install",
37+
38+
// Use 'postStartCommand' to run git proxy configuration after the container is started.
39+
"postStartCommand": "git config --global http.proxy http://host.docker.internal:7890"
3340

3441
// Configure tool-specific properties.
3542
// "customizations": {},

0 commit comments

Comments
 (0)