How can I debug gitlab in docker with rubymine interactive debugger?

I’m trying to setup rubymine debugger with gitlab which is running inside docker.
(I’m doing this for security testing and learning programming purposes)

I have such an error while trying to create ruby remote interpreter for docker engine:

Have anyone tried to set this up? Any tips how to make it work?
Maybe it’s a problem with env variables inside docker or something specific for ruby ecosystem?

If you’re developing GitLab, the guide for RubyMine setup at may be of help (among other guides in the same project).