0
1

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.

MacでホストからDockerコンテナにlocalhostでアクセスできなかった話

Posted at

事象

Macでdockerの公式ドキュメントに従ってもnginxのコンテナにlocalhostでアクセスできない :sob:

公式ドキュメント
Networking features in Docker Desktop for Mac

環境

  • macOS Catalina 10.15.6
  • docker desktop community
    • Version 2.3.0.3(45519)
    • Channel stable
    • Engine 19.03.8
  • eset CYBER SECURITY PRO
    • Version 6.8.300.0

原因・解決方法 :relaxed:

こちらの回答の通り、セキュリティソフトのファイアウォールが原因でした
teratail: docker desktop for macでホストからコンテナに接続できない

所感 :rolling_eyes:

この答えに行き着くまでに様々なことを疑いました

  • コンテナに対するポートフォーワーディング
  • コンテナのポート公開設定
  • コンテナのOS上のファイアウォール設定
  • コンテナに割り当てられたIPアドレスでのアクセス

などなど。
しかし、どれもこれも解決に至らず。。。

セキュリティソフトが原因なのは盲点でした。
これまでの経験でも同じようなことはあったのですが、最近はなかったことだったので。

セキュリティソフト以外に原因が考えられる場合は下記サイトが参考になると思います。
Dockerコンテナで起動したサーバにアクセスできないときの確認と対処方法

#なんか今回は他所のサイト紹介みたいになっている。。。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?