環境:CentOS(64bit)
內核:3.10.0-957.el7.x86_64
安裝docker步驟見:https://www.runoob.com/docker/centos-docker-install.html
坑1:添加軟件源信息時,yum-config-manager報錯
File "/bin/yum-config-manager", line 135
except yum.Errors.RepoError, e:
^
SyntaxError: invalid syntax
原因是安裝python3.x後python鏈接爲python3.6,需要在 /bin/yum-config-manager中將python修改爲python2.7
詳見:https://blog.csdn.net/shunzi2016/article/details/79697972
坑2: docker安裝好後測試運行 hello-world報錯
Unable to find image 'hello-world:latest' locally docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers). See 'docker run --help'.
原因是docker默認鏡像是國外的服務器,需要修改成國內的服務器,如阿里,
詳見:https://blog.csdn.net/wireless911/article/details/88989620