To run the container, use the following run command as a guideline. This includes a volume for external configuration of the installed extensions, including Xdebug, which allows changing the settings on the fly and persisting them, if you don't need it just remove that -v parameter:
you have to activate debugging, either with a browser extension, or appending ?XDEBUG_SESSION_START=1 to the url in your browser
xdebug.remote_autostart = 1
debugging starts immediately
xdebug.remote_connect_back
xdebug.remote_connect_back = 0
On your debugging tool, you need to setup the remote host ip address
xdebug.remote_connect_back = 1
xdebug detects the caller ip address. When called in a container, xdebug will detect this as the local ip address (eg: 172.17.0.1), and it should connect to the ip address on the network (eg: 192.168.1.x), so this probably won't work
xdebug.remote_host
if remote_connect_back = 0, set this to your host's ip address on the network. Find it with ifconfig (ipconfig on Windows), and use it here
if on a Mac, you should set this to xdebug.remote_host=docker.for.mac.localhost