atlas200dk 安装docker
一、设置apt 国内源
Ubuntu 18.04 使用apt-get 华为源支持 arm64 鲲鹏处理器
网上搜的源,什么阿里云163等等的,都不支持arm64
执行以下代码,使用华为源
wget -O /etc/apt/sources.list https://repo.huaweicloud.com/repository/conf/Ubuntu-Ports-bionic.list
apt-get update
二、安装docker
1.先卸载可能存在的旧版本
apt remove docker docker-engine docker-ce docker.io
2.更新apt包索引
apt update
3.安装以下包以使apt可以通过HTTPS使用存储库
apt install -y apt-transport-https ca-certificates curl software-properties-common
4.添加docker的密钥
使用阿里云的docker源进行安装的话要添加对应源的密钥,docker官方的要对应官方的密钥,选择不同的源安装密钥不一样的
阿里云
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
中科大源
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
国外官方docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
通过上面可以看出,对于不同的源只能网址里面的域名变化了,同样可以使用其他的源,比如网易、中科大等
5.在ubuntu的系统源中添加对应的docker源
ubuntu的系统源文件位置位于
/etc/apt/sources.list
阿里源
sudo add-apt-repository "deb [arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
中科大源
sudo add-apt-repository "deb [arch=arm64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
其中$(lsb_release -cs)是个系统函数,可以自动获取当前ubuntu系统的版本,arm64对应的cpu的版本,我的主板是arm的,如果是电脑或者服务器注意是安装 amd64的,需要把arm64替换成amd64
同理第四步,添加docker镜像源的时候,网址里面的域名也要看选择哪个源而变化的,上面举例的是阿里的源添
docker-ce镜像-docker-ce下载地址-docker-ce安装教程-阿里巴巴开源镜像站
6.再次更新 apt 包索引
apt update
7.安装最新版本的Docker CE
apt install docker-ce
如果第7步安装出现404或者没有找到包的情况,说明在第五步的时候镜像源配置出错,或者是当前的镜像源没有同步到最新的版本,考虑换一个,如果是用官方的话,是最稳的,没有同步的情况,就是慢了一点
8.验证docker
systemctl status docker更多推荐
所有评论(0)