美文网首页
Windows 10 子系统Ubuntu安装Docker详细步骤

Windows 10 子系统Ubuntu安装Docker详细步骤

作者: 扶我起来改bug | 来源:发表于2020-04-11 21:26 被阅读0次

    Windows 10 子系统安装docker,并解决Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 问题。

    1. 搜索框中搜索开发者设置 image.png
    2. windows 设置打开开发者选项 image.png
    3. 搜索框中搜索windows功能 image.png
    4. 勾选使用于Linux的Windwos子系统 image.png
    5. 安装 Docker Desktop for Windows

      下载地址:https://www.docker.com/products/docker-desktop

      安装成功后打开 Expose daemon on tcp://localhost:2375 without TLS

    6. 在Microsoft Store中搜索Ubuntu,然后安装就行 image.png
    7. Ubuntu安装成功后打开(第一次打开需要设置用户名和密码) image.png
    8. 然后依次执行以下命令:

      Docker 官网安装步骤: https://docs.docker.com/engine/install/ubuntu/ ,不想看官网的直接按照以下命令执行即可

        $ sudo apt-get update
        $ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
        $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
        $ sudo apt-key fingerprint 0EBFCD88
        $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
        $ sudo apt-get update
        $ sudo apt-get install docker-ce
        $ docker -H localhost:2375 images
        $ export DOCKER_HOST=localhost:2375
        $ echo "export DOCKER_HOST=localhost:2375" >> ~/.bashrc</pre>
    

    到此docker就安装就成功了,可以愉快的玩耍了。

    相关文章

      网友评论

          本文标题:Windows 10 子系统Ubuntu安装Docker详细步骤

          本文链接:https://www.haomeiwen.com/subject/gajpmhtx.html