apprenticeteam2 / task

0 stars 0 forks source link

dev compose upのエラー【port番号エラー】 #14

Open takuro3000 opened 7 months ago

takuro3000 commented 7 months ago

エラー内容

Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3306 -> 0.0.0.0:0: listen tcp 0.0.0.0:3306: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.

作業コマンド

docker compose up --build完了時に、上のエラーが出る

jagaimoUK commented 7 months ago

port番号のエラー

jagaimoUK commented 7 months ago

https://qiita.com/Quantum/items/8891fa9c94d03b388555

解決策1

Windows PowerShell で、netstat -ano | Select-String ":3306"を実行。 プロセスIDが表示された場合、taskkill /F /PID 20344を参考に、プロセスIDをキルする。

jagaimoUK commented 7 months ago

解決策2

NAT再起動 (管理者権限で起動したPowerShel) Restart-Service -Name winnat

jagaimoUK commented 7 months ago

解決策1でアクセスが拒否された場合

https://qiita.com/Noburo/items/55b4c36d02fedb5a7af6

takuro3000 commented 7 months ago

エラー2

作業コマンド sudo docker compose up --build エラー内容 ERROR [web internal] load metadata for docker.io/library/ruby:3.3.0 30.9s

[web internal] load metadata for docker.io/library/ruby:3.3.0:

failed to solve: DeadlineExceeded: DeadlineExceeded: DeadlineExceeded: ruby:3.3.0: failed to authorize: DeadlineExceeded: failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fruby%3Apull&service=registry.docker.io": dial tcp 54.236.113.205:443: i/o timeout

jagaimoUK commented 7 months ago

【エラー2】解決策1

Port Already in Use: The most common reason for this error is that another process is already using port 3306. You can check which process is using it by running the following command on a Unix-like system:

sudo lsof -i :3306 or sudo netstat -tulnp | grep 3306

This will show you the PID of the process using the port, which you can then investigate or terminate if necessary.

jagaimoUK commented 7 months ago

Windows Powershellでsudoが使用できない場合

https://zenn.dev/ryuu/articles/wanttousesudo-with-win#sudo-%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB

jagaimoUK commented 7 months ago

vscodeのターミナルを、ubuntuにする

vscode integrated terminal を ubuntuにする https://tenshoku-miti.com/takepon/windows-vscode-ternimal-ubuntu/#:~:text=%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E5%AE%8C%E4%BA%86-,VSCode%E4%B8%8A%E3%81%A7%E8%B5%B7%E5%8B%95%E3%81%99%E3%82%8B%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%82%92Ubuntu%EF%BC%88bash%EF%BC%89%E3%81%AB%E5%A4%89%E6%9B%B4,-%EF%BC%91.%20VSCode%E3%81%AE

jagaimoUK commented 7 months ago

【エラー2】解決策2

https://qiita.com/mrk_____mr/items/60ed219c5c4349cbbb2e