1.安装
sudo apt-get remove docker docker-engine docker.io containerd runc $ sudo apt-get update $ sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get -y update sudo apt-get install docker-ce docker-ce-cli containerd.io sudo apt-get -y install docker-ce sudo docker version
2.启动
启动docker
sudo service docker start
停止docker
sudo service docker stop
重启docker
sudo service docker restart
3.卸载
sudo apt-get purge docker-ce docker-ce-cli containerd.io sudo rm -rf /var/lib/docker
开机启动
sudo systemctl enable docker
设置当前用户免sudo
--添加组 sudo groupadd docker --添加用户到组(user改当前用户名) sudo gpasswd -a user docker --更新组 newgrp docker --重启docker sudo service docker restart