I am running a Docker container inside AWS Elastic Beanstalk, running Amazon's 'Amazon Linux', which I believe is a CentOS derivative.
In my development environment, I'd like to enable debugging on my app so I can remote debug from my local machine. This of course requires an additional port, but AWS by default will only map one port in the Docker container onto the host.
I'm on the machine, and I can see that the Docker container has a local address (172.x.x.x), and I can hit the debugging port on that address directly when I'm on the host. The problem is that this address is of course not accessible from my local machine.
I'd like to manually create a port forwarding rule to forward calls on
<docker-local-ip>:<port> so that I can connect for remote debugging. I believe iptables is probably the right tool for this, but I am not familiar with its usage. How can I achieve this goal?