Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker 在Windows上使用WSL2和VS代码容器进行SSH转发_Docker_Visual Studio Code_Windows Subsystem For Linux - Fatal编程技术网

Docker 在Windows上使用WSL2和VS代码容器进行SSH转发

Docker 在Windows上使用WSL2和VS代码容器进行SSH转发,docker,visual-studio-code,windows-subsystem-for-linux,Docker,Visual Studio Code,Windows Subsystem For Linux,我在Windows上的WSL2下运行Ubuntu。在Ubuntu内部,我克隆了我的存储库,它被设置为运行docker。当我在项目中运行docker compose up时,它成功启动,我可以从Windows上的VS代码打开容器 当我试图从VS代码内部使用任何git特性时,问题就出现了。我刚刚得到一个权限被拒绝(公钥)。如果在VS code内部打开终端(连接到容器),则在运行git pull时会出现相同的错误 如果我从Ubuntu终端运行docker compose运行WebBash,我可以成功运

我在Windows上的WSL2下运行Ubuntu。在Ubuntu内部,我克隆了我的存储库,它被设置为运行docker。当我在项目中运行
docker compose up
时,它成功启动,我可以从Windows上的VS代码打开容器

当我试图从VS代码内部使用任何git特性时,问题就出现了。我刚刚得到一个
权限被拒绝(公钥)
。如果在VS code内部打开终端(连接到容器),则在运行
git pull
时会出现相同的错误

如果我从Ubuntu终端运行
docker compose运行WebBash
,我可以成功运行
git pull
。所以代理被转发到容器中,它在VS代码中无法工作

我有没有遗漏一些设置