更多内容: http://blog.codeye.toplinux
Ubuntu Server 16.04(LTS) amd64web
sudo apt-get remove docker docker-engine docker.io containerd runc
It’s OK if apt-get reports that none of these packages are installed.docker
默认就行ubuntu
一、更新包索引windows
sudo apt update
二、安装依赖包bash
$ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
三、添加Docker的官方GPG密钥curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
经过搜索指纹的最后8个字符,验证您如今拥有带指纹的密钥tcp
sudo apt-key fingerprint 0EBFCD88
四、Docker stable 稳定版本svg
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" && apt-get update
五、经过运行hello-world 映像验证是否正确安装了Docker CEurl
sudo docker run hello-world
六、基本操做
sudo usermod -aG docker ubuntu
ubuntu@DESKTOP-LJ47B6Q:~$ docker run hello-world docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See 'docker run --help'. ubuntu@DESKTOP-LJ47B6Q:~$ sudo systemctl start docker [sudo] password for ubuntu: System has not been booted with systemd as init system (PID 1). Can't operate. ubuntu@DESKTOP-LJ47B6Q:~$
报错内容:
上图中相关指令:
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
$ docker -H tcp://0.0.0.0:2376 images REPOSITORY TAG IMAGE ID CREATED SIZE
$ echo >> ~/.bashrc <<EOF # Connect to Docker on Windows export DOCKER_HOST=tcp://192.168.99.100:2376 // your Docker IP export DOCKER_CERT_PATH=/mnt/c/Users/YOUR_USERNAME/.docker/machine/certs export DOCKER_TLS_VERIFY=1 export DOCKER_HOST='tcp://0.0.0.0:2375' EOF $ source ~/.bashrc
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE