LoginSignup
0
0

More than 3 years have passed since last update.

Mac で docker-compose up した時にポートエラーになった際の対処法

Posted at

これは何?

docker-compose up でコンテナを立ち上げようとした際に以下エラーが出たのでその対処法を記載している。

Starting lb ... error
ERROR: for lb  Cannot start service lb: Ports are not available: listen tcp 0.0.0.0:80: bind: address already in use

原因と対処法

文字通り他のアプリケーションがポート 80番を使用しているため使えないという内容。
なので、ポートを使用しているプロセスを探す。

$ sudo lsof -i -P | grep ":80"

httpd が 80番ポートを使っていることがわかった。

httpd      103            root    4u  IPv6 0xb54e8c868de16e45      0t0    TCP *:80 (LISTEN)
httpd     1221            _www    4u  IPv6 0xb54e8c868de16e45      0t0    TCP *:80 (LISTEN)
com.docke 2202 ishiharanaohiro   83u  IPv6 0xb54e8c868494ae45      0t0    TCP *:8025 (LISTEN)

httpd の PID(103、1221) を削除する。

$ kill -l 103
$ kill -l 1221

docker-compose up -d で無事起動。めでたしめでたし!

Starting lb ... done
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0