1.查看现有版本
cat /etc/issue //(简单) cat /etc/lsb-release //(具体)
2.步骤
$ sudo apt-get update $ sudo apt-get upgrade $ sudo apt-get dist-upgrade $ sudo do-release-upgrade
3.安装docker
第一步:更新系统
apt-get update
报错:Unable to lock directory /var/lib/apt/lists/
执行:sudo fuser -vki /var/lib/apt/lists/lock
查看系统版本及内核,Docker需要运行在3.8以上的内核
cat /etc/issue //查看系统版本 uname -r //查看内核
第二步:安装docker
apt-get install docker.io
验证安装是否成功
sudo docker run hello-world
其它相关命令
sudo service docker start //启动 docker info //查看信息
第三步:安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
赋予执行权限
sudo chmod +x /usr/local/bin/docker-compose
检查是否安装成功
docker-compose --version
参考链接:
https://docs.docker.com/engine/install/ubuntu/
https://docs.docker.com/compose/install/