Featured image of post 解決 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. 問題

解決 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. 問題

在 Windows 使用 WSL2 的 Ubuntu 系統安裝 docker 時,出現 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. 問題

Photo by Rubaitul Azad on Unsplash

問題

在 Windows 的 WSL Ubuntu 安裝完 Docker 時無法啟動 docker,跑出下列的訊息

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

解法

A. 重新啟動 Docker 系統服務

systemctl start docker
gpasswd -a $USER docker

B. 手動啟動 Docker 服務

sudo dockerd

原因是 Docker 服務沒有被啟動,只要將服務重新啟動即可使用 Docker!

Reference

Donate KJ 贊助作者喝咖啡

如果這篇文章對你有幫助的話,可以透過下面支付方式贊助作者喝咖啡,如果有什麼建議或想說的話可以贊助並留言給我
If this article has been helpful to you, you can support the author by treating them to a coffee through the payment options below. If you have any suggestions or comments, feel free to sponsor and leave a message for me!
方式 Method 贊助 Donate
PayPal https://paypal.me/kejyun
綠界 ECPay https://p.ecpay.com.tw/AC218F1
歐付寶 OPay https://payment.opay.tw/Broadcaster/Donate/BD2BD896029F2155041C8C8FAED3A6F8
All rights reserved,未經允許不得隨意轉載
Built with Hugo
Theme Stack designed by Jimmy