Greetings and salutations!
I am trying to remotely debug a process running inside of a Docker container. I can connect to lldb-server from my host, but can't launch a debugging process. I can debug the target locally, inside or outside of the container.
lldb-server-4.0 platform --verbose --listen "*:5000"
(lldb) target create target/debug/hist
(lldb) platform connect connect://localhost:5000
OS Version: 4.15.0 (4.15.0-45-generic)
Kernel: #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019
error: connect remote failed (Connection refused)
error: process launch failed: Connection refused
Docker is a containerization system that sandboxes the processes it manages in various ways. Processes inside of the container are running on a virtualized network stack and do not know the IP address of their host and cannot communicate to the outside except on "published" ports, for instance.
A mail  on this list dating to 2017 suggested the problem is that the gdbserver child process spawned by `process launch` can't talk to Docker over the firewall. However, I don't believe it's the issue - or at least, not the only one.
I isolated this problem by binding 5000 and 5001 in the container to the same values in the host. Then, I restricted the acceptable range of gdbserver ports to just 5001, using the flags suggested in the email.
lldb-server-4.0 platform --verbose --listen "*:5000" --min-gdbserver-port 5001 --max-gdbserver-port 5001
This had no apparent effect.
I also found a pull request  from 2018 which suggested that the problem is the virtualized IP address in the container. That is a promising direction, but unfortunately, that patch was abandoned and nothing took its place.
There are traces of this issue all over the net, but none of them that I have found were ever resolved. I think that remote-debugging a Docker container is an increasingly important use-case for lldb-remote, and if anyone is interested in this, I'm happy to work with you to hammer it out.
Unanswered Stack Overflow 
A bug filed on Swift's tracker