I'm trying to run debug mode in Pycharm on Linux (Ubuntu) with Docker of Lean. I followed the instruction at the Lean page

https://github.com/QuantConnect/Lean/blob/master/.idea/readme.md#Running-Lean-in-the-Container

However, when I start Pycharm (Debug Server) first, then Docker, Docker will fail, saying 'address already in use'. If I did it the other way, Pycharm will fail, saying 'Failed to find free port'. It seems that when either Pycharm or Docker starts, it will attempt to get a hold on to the port, hence when Docker starts (as per instruction) it is unable to get hold of the port. I've tried to change the command for Docker "-p 5678:5678" to "-p 127.0.0.1:5678:5678" (or even IP address) to attempt to make Docker to 'connect to' rather than to 'listen'. That doesn't help.

Docker version 19.03.13
Python 2.7.17
PyCharm Pro 2019.1.3