大家好,又见面了,我是你们的朋友全栈君。
docker需要ubuntu的内核高于3.10
uname -r
# 新增更新源
sudo echo "deb https://download.docker.com/linux/ubuntu zesty edge" > /etc/apt/sources.list
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce
国内从 DockerHub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
在**/etc/docker/daemon.json**中写入如下内容(如果文件不存在请新建该文件):
{
"registry-mirrors":["https://reg-mirror.qiniu.com/"]}
重新启动服务:
$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/162711.html原文链接:https://javaforall.cn