0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

コンテナを起動時にポート番号重複のエラーが発生

Last updated at Posted at 2021-06-25

docker-compose up -d を実行し、コンテナを起動しようとしたら以下のエラー。

ERROR: for webapp_web_1  Cannot start service web: driver failed programming external connectivity on endpoint webapp_web_1 (中略): Bind for 0.0.0.0:80 failed: port is already allocated

ERROR: for web  Cannot start service web: driver failed programming external connectivity on endpoint webapp_web_1 (中略): Bind for 0.0.0.0:80 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

原因

port is already allocated という文を見てみます。
どうやらポート番号が重複しているみたいです。

解決策

Dockerfile にてポート番号を変更したら解決しました。

Dockerfile
ports:
      - 80:80

80 から 任意の数値に変更します。

Dockerfile
ports:
      - 81:81

エラー文はきちんと読まないとダメですね。気をつけます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?