一、安装Docker
##1.安装curl命令
sudo apt-get install curl
##2.下载安装docker
curl -sSL https://get.docker.com/ | sh
二、启动Docker
1.启动
sudo service docker start
2.验证启动是否成功
docker version
三、可能出现的问题
如果出现如下错误:
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
需要添加当前用户到docker组中,然后重新登陆即可.
sudo usermod -a -G docker $USER