docker on wsl2 very slow

后端 未结 6 1943
离开以前
离开以前 2021-01-01 17:13

After having read about the performance improvements when running Docker on wsl2, I have been waiting for the official release of Windows 10 that supports wsl2. I updated Wi

6条回答
  •  执念已碎
    2021-01-01 18:05

    Probably you have your code on the Windoes machine like in

    C:\\Users\YourName\projects\blahfu
    

    But you're using docker on WSL 2 which is then on another filesystem. So if you do a docker build you got all the code/context copied from Windowsfilesystem to Linux filesystem and then from there to the docker container. This takes it's most of hte time and is incredibly slow.

    Try to put your project into

    /home/YouName/projects/blahfu
    

    This should give quite a performance boost.

提交回复
热议问题