当前位置: 首页> 财经> 产业 > Ubuntu 安装docker

Ubuntu 安装docker

时间:2025/7/9 0:55:55来源:https://blog.csdn.net/abc666_666/article/details/140133966 浏览次数:0次

Centos的docker安装相对来说比较简单,通过yum install docker就可以了,最近来了台Ubuntu的linux系统,但其安装方式相较于centos来说,有些复杂,先将其做个记录

安装前准备

sudo apt install ca-certificates curl gnupg lsb-release

添加GPG key

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add –

添加apt

add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

 

安装docker

apt-get install docker-ce docker-ce-cli containerd.io

 检查docker安装情况

docker --version

说明docker安装成功了

配置docker镜像源

vim /etc/docker/daemon.json

 

{"registry-mirrors" :["https://docker.m.daocloud.io","https://noohub.ru","https://huecker.io","https://dockerhub.timeweb.cloud"]
}

重启时生效

systemctl daemon-reload
systemctl restart docker

检查

docker info

Hello Wold

docker container run –rm hello world

说明我们的docker以成功安装,并可以拉取相应的镜像文件了。 

关键字:Ubuntu 安装docker

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: