2017-07-15 75 views
1

我使用Homebrew在我的Mac OSX機器(El-Capitan)上安裝了Docker。爲什麼我無法在Mac OSX上運行Docker?

但是當我嘗試運行它時,它給了我下面顯示的錯誤。

$ docker --version 
Docker version 17.06.0-ce, build 02c1d87 

$ docker-compose --version 
docker-compose version 1.14.0, build unknown 

$ docker-machine --version 
docker-machine version 0.12.2, build 9371605 

$ docker ps 
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. 
Is the docker daemon running? 

我該如何解決?

+0

我建議你擺脫這一點,並從Docker網站獲取Mac的Docker。更容易處理。它爲你處理一些後端的東西,你必須用docker-machine自己做。 –

回答

1

看起來你需要先啓動Docker守護進程。檢查brew info docker-machine的警告部分。

$ brew info docker-machine 
docker-machine: stable 0.12.2 (bottled), HEAD 
Create Docker hosts locally and on cloud providers 
https://docs.docker.com/machine 
Not installed 
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/docker-machine.rb 
==> Dependencies 
Build: go ✔, automake ✔ 
==> Requirements 
Build: git ✔ 
==> Caveats 
To have launchd start docker-machine now and restart at login: 
    brew services start docker-machine 
Or, if you don't want/need a background service you can just run: 
    docker-machine start 
+0

這並沒有工作:https://gist.github.com/saqib-zmi/f7b36cea6ad337f586521b2fdc8f1780 –

+0

@SaqibAli嗯,你可以在控制檯找到任何關於它的日誌? –

+1

請參閱_創建machine_的步驟6,網址爲https://docs.docker.com/machine/get-started/#create-a-machine。 –

相關問題