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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM