与IntelliJ和Docker的Xdebug不工作。 如何解决?

我的IDE是IntelliJ,它configuration和使用Xdebug和PHP 5.6。

它在我的主机(MacOS)中工作,但是当我打开Docker时,debugging过程失败。

如果我尝试公开端口9000( docker run -p 80:80 -p 9000:9000 ... ),当我运行图像时,我得到一个错误IntelliJ – > port 9000 is in use

如果我不暴露端口9000,我在IntelliJ里面什么都没有,

这里是docker中php.ini的一部分:它显示xdebug已经启用。

 [xdebug] zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so xdebug.remote_enable=1 xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_autostart=1 

在这里输入图像说明

我做错了什么?