Docker支持CentOS6及之後的版本。 對於CentOS6系統可使用EPEL庫安裝docker,命令以下:docker
sudo su yum install -y http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm yum install -y docker-io
然而運行以上代碼後,使用docker命令(如 docker images)仍會報錯以下:json
Get http:///var/run/docker.sock/v1.19/images/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
解決方法爲: 根據系統服務管理不一樣(centos6是upstart),運行如下命令,能夠建立/var/run/docker
:centos
systemd: sudo systemctl start docker upstart: sudo service docker start init.d: sudo /etc/init.d/docker start
同時這些命令也能夠解決以下報錯:this
FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?