0
0

More than 3 years have passed since last update.

【docker-compose&&run時に「listen tcp 0.0.0.0:xxx: bind: address already in us」エラー対処】

Last updated at Posted at 2021-01-30

こんちわ〜
UdemyでDokcer講座を購入して、エラーに詰まったので、それの対処法を備忘録として残します!

「listen tcp 0.0.0.0:xxx: bind: address already in us」 解決手順

  • 【エラーログ:原因】

    • Error response from daemon: Ports are not available: listen tcp 0.0.0.0:8888: bind: address already in use. ERRO[0000] error waiting for container: context canceled
    • どうやら「0.0.0.0:8888ポートが使われてるから、利用できません」と叫んでます
  • 【対処法】

    • ⑴ ポート8888が使われているプロセスを確認 
      • プロセスとは実行中のプログラムのこと
    • sudo lsof -i -P | grep "LISTEN" を叩き確認する

      • sudo = スーパーユーザーの権限でコマンド実行する時のコマンド
      • lsof = プロセスが開いているファイルを表示するコマンド
      • -i = ネットワークソケットファイルを指定する
        • ネットワークソケットファイル = ネットワークの接続口のこと
      • -P = ポート名をサービスネームに指定しない
      • grep = 指定した文字列(のある行)を検索するときに使うコマンド
      • "LISTEN" = 通信機能を持つソフトウェアが、外部からのアクセスに備えて待機すること
        (grepの検索される文字列)
  • 【表示内容】

    • httpd 40812 **** 4u IPv6 0x5d70488c5d7bfe07 0t0 TCP *:8888 (LISTEN)
  • 【プロセスを終了するコマンド】

    • kill プロセス番号(PID)
    • kill 40812

よし!!これでdocker run できる!!!

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