學習目標
- 解決啟動 docker-compose 時發生的錯誤
- ERROR: Couldn’t connect to Docker daemon at http+docker://localunixsocket - is it running? If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Step 1. 將當前用戶加入 docker 群組
❖ 在 【 Terminal 】中輸入下方指令
sudo gpasswd -a ${USER} docker
Step 2. 退出當前用戶
❖ 在 【 Terminal 】中輸入下方指令
sudo su
Step 3. 再次切换到 ubuntu 用戶
❖ 在 【 Terminal 】中輸入下方指令
su ubuntu
Step 4. 啟動 docker-compose
❖ 在 【 Terminal 】中輸入下方指令
docker-compose up -d