docker version 如果显示以下内容

时间:2022-06-26 02:30:49

在Windows下安置Docker for Windows 在WSL下安置Docker for Windows

先确定根基环境部署告成。

sudo apt-get -y install apt-transport-https ca-certificates curl curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update

然后安置Docker

sudo apt-get -y install docker-ce

变动WSL连接Docker server的默认端口:进入~/.bashrc,在最底端添加:

export DOCKER_HOST=tcp://0.0.0.0:2375

刷新bash配置

source ~/.bashrc 测试是否告成

检察Docker版本。

docker version

如果显示以下内容,,则暗示已经告成。

Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:10:01 2018 OS/Arch: linux/amd64 Experimental: false Orchestrator: swarm Server: Engine: Version: 18.03.0-ce API version: 1.37 (minimum version 1.12) Go version: go1.9.4 Git commit: 0520e24 Built: Wed Mar 21 23:14:32 2018 OS/Arch: linux/amd64 Experimental: false 参考文档

Docker安置——Ubuntu16.04
Setting Up Docker for Windows and WSL to Work Flawlessly