(我的環境是Mint7.1,相當於Ubuntu14.04)
1,首先,根據docker.com上的安裝指導來安裝docker,這里就不重復了,參考:
https://docs.docker.com/installation/ubuntulinux/
2,執行
$ docker version
你可能遭遇如下錯誤:
FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
這可能是由於沒有把當前用戶加入docker組中,執行
$ sudo gpasswd -a ${USER} docker
重啟機器,檢查當前用戶是否在docker組中
$ groups
執行命令重啟服務
$ sudo service docker.io restart
參考
http://stackoverflow.com/questions/27782595/starting-docker-containers-from-php
http://dev-maziarz.blogspot.com/
3,再次執行
$ docker version
你可能遭遇如下錯誤:
FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
這可能是由於沒有安裝apparmor造成的,執行
apt-get install apparmor
重啟電腦,執行:
$ ps -ef | grep docker
root 4577 1 0 21:44 ? 00:00:00 /usr/bin/docker -d
alex 4608 2574 0 21:45 pts/0 00:00:00 grep --color=auto docker
以上輸出就說明安裝成功了。
參考:
http://www.tekhead.org/blog/2014/09/installing-docker-on-ubuntu-quick-fix/