Is Docker running within WSL or connecting back to Windows?

前端 未结 3 1465
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 22:27

After successfully installing Docker in WSL, if I run standard Docker commands, I get connection errors. Runing with sudo or not yields the same result in all examples.

3条回答
  •  一向
    一向 (楼主)
    2021-01-04 23:24

    This is a workaround which is to use Docker on windows in WSL instead.

    Just add the following to your WSL .bashrc file.

    export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
    export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
    alias docker=docker.exe
    alias docker-compose=docker-compose.exe
    

    Reference: https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

提交回复
热议问题