使用vscode远程连接docker容器,进入容器后报错
Updating C/C++ dependencies...
Downloading package 'C/C++ language components (Linux / x86_64)' Failed. Retrying... Failed. Retrying... Failed. Retrying...Waiting 8 seconds... Failed. Retrying...Waiting 15 seconds... Failed. Retrying...Waiting 15 seconds... Failed. Retrying...Waiting 15 seconds... Failed. Retrying...Waiting 15 seconds... Failed. Retrying...Waiting 15 seconds... Failed. Retrying...Waiting 15 seconds... Failed to download https://go.microsoft.com/fwlink/?linkid=2175018
Failed at stage: downloadPackages
Error: Failed to establish a socket connection to proxies: ["PROXY 127.0.0.1:8889"]
If you work in an offline environment or repeatedly see this error, try downloading a version of the extension with all the dependencies pre-included from https://github.com/microsoft/vscode-cpptools/releases, then use the "Install from VSIX" command in VS Code to install it.
打开报错提示中的网站,下载文件cpptools-linux.vsix
![在这里插入图片描述](https://img-blog.csdnimg.cn/c9f4ff233835486aae46705c891080c1.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5a6J5a6J6JqB,size_20,color_FFFFFF,t_70,g_se,x_16)
下载完成之后,重新启动容器,记得将软件所在位置映射到容器中(我使用-v /home/aviana/Downloads:/root/data
将文件所在地址映射到了容器内部/root/data
)),在vscode中选中扩展插件,点击...
,选择Install from VSIX...
然后选择下载的文件(容器内部地址/root/data
)
![在这里插入图片描述](https://img-blog.csdnimg.cn/7a9494076a2d4ff4a58ae6f3a8ce2ccd.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5a6J5a6J6JqB,size_20,color_FFFFFF,t_70,g_se,x_16)
安装完成。