On linux with firewalld enabled, the container hasn't route for host, so it not attach to host port 9000 (xdebug). The route can be add by:
firewall-cmd --zone=public --add-rich-rule='rule family="ipv4" source address="172.17.0.0/16" accept'
Where 172.17.0.0 is docker container's subnet (check it with ifconfig).
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.