visual-studio-code - VS Code 开发容器:无法下载 VS Code Server
问题描述
每次我更新 VS Code 时,我的开发容器都会中断Failed to download VS Code Server
:
[16413 ms] Installing VS Code Server for commit d2e414d9e4239a252d1ab117bd7067f125afd80a
[16413 ms] Start: Run in container: mkdir -p /home/<my_username>/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a_1602875933619
[16432 ms]
[16432 ms]
[16470 ms] Start: Downloading VS Code Server
[16686 ms] Failed to download VS Code Server (https://update.code.visualstudio.com/commit:d2e414d9e4239a252d1ab117bd7067f125afd80a/server-linux-x64/stable): HTTP 403 - Forbidden
我很确定这是因为它没有使用代理。
我的 devcontainer.json 指的是图像,而不是 dockerfile,并且 HTTPS_ 和 HTTP_PROXY 被烘焙。还有同名的小写变量。
我有http.proxy
并https.proxy
配置在devcontainer.json
.
我在守护进程配置中设置了代理,在我的配置文件中设置了我的 docker 配置。其他网络流量使用代理。
我试过用--proxy-server
.
我试过设置/etc/wgetrc
。这些都没有骰子。
这在 1.47 左右开始出现。
启动后,此容器使用代理没有问题。我的解决方法是从日志中的失败或通过本地运行获取提交 ID code -v
,然后将 shell 附加到正在运行的开发容器并运行此节:
commit=d2e414d9e4239a252d1ab117bd7067f125afd80a # <= replace this
cd ~/.vscode-server/bin
mkdir ${commit}
curl https://update.code.visualstudio.com/commit:${commit}/server-linux-x64/stable -L --output ${commit}.gz
tar --no-same-owner -xz --strip-components 1 -C ./${commit} -f ./${commit}.gz
说我和我的团队对此感到厌倦是轻描淡写的。真正的解决办法是什么?
解决方案
看起来这在 1.55.0 中已修复。
w00t w00t!
推荐阅读
- python - 如何标记以 . 分隔的十进制数字。(点)
- javascript - 未捕获的类型错误:无法在我的函数上读取未定义的属性“then”
- c# - 未针对特定表名解析表名
- python - Flink Streaming Python API - reduce() 产生增量结果而不是最终值
- c++ - “偶尔”的分段错误
- magento-1.9 - 在 magento 中自定义页眉和页脚
- java - 如何使用http从Java后端在Angular前面显示一些数据
- java - 对 JBoss 中配置的 JMS 队列执行 JNDI 查找时出现问题
- javascript - 失败的断言不会使 nightwatch 中的当前测试用例失败
- nativescript - NativeScript 角度 nativeView 未定义