CentOS使用阿里源安装最新版Docker
安装步骤:
1、卸载已经安装的Docker
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine
2、配置阿里云yum源仓库
1 sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、查看可以安装的docker版本
1 #yum list docker-ce --showduplicates | sort -r //查看可以安装的版本并倒序排序
4、安装最新版本Docker
注意:安装Docker最新版本,无需加版本号:
1 sudo yum install -y docker-ce
5、设Docker阿里云加速器
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://lkq3q0he.mirror.aliyuncs.com"] } EOF
6、启动Docker
sudo systemctl daemon-reload //重新加载服务配置文件 sudo systemctl enable docker.service && systemctl restart docker.service //设置开机启动与重启docker服务
7、查看Docker版本
~#docker version Client: Docker Engine - Community Version: 19.03.8 API version: 1.40 Go version: go1.12.17 Git commit: afacb8b Built: Wed Mar 11 01:27:04 2020 OS/Arch: linux/amd64 Experimental: false ........... ~#docker info Client: Debug Mode: false Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 19.03.8 Storage Driver: overlay2 Backing Filesystem: <unknown> Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs
https://www.cnblogs.com/cloudos/