|
Re: Debug Docker Container Port Problem [message #1796972 is a reply to message #1796756] |
Tue, 23 October 2018 11:47 |
Claudio Rossner Messages: 4 Registered: October 2018 |
Junior Member |
|
|
Really no help?
Maybe my description of the problem is not good enough, i try it again:-)
- I have installed latest EclipseCDT (Photon) on my Host => Linux CentOS 7 - running fine
- I have a C++ Application created which is a Webservice - code and binary is on my Host
- I have also installed Docker on this CentOS 7 - running fine
- I have created a Docker Image with Alpine Linux, G++, GDB, GDBServer and some more Libs (Boost, WT...) in there needed for my C++ Application to work/run (these Libs are not installed on my Host - only in the docker image)
- I did start the Docker-Image (mydocker/images:cpp-app) and the container runs, EclipseCDT is finding the Libs and can compile the code so i get the binary from my C++-Source-Code
So everything is fine til here, but now i want to debug this C++ App/Binary - this needs Debugging within a container, for that i have parametrized the following:
Debug Configurations:
[C/C++ Container Launcher]
Project: MyCppApp
C/C++ Application: Debug/MyCppApp
Arguments: --http-address=0.0.0.0 --http-port=8166
[Container]
Connection: unix:///var/run/docker.sock
Image: mydocker/images:cpp-app
Required host directories: /home/myuser/MyCppApp
Additional Options: Checked all (Keep Container after Launch, Support stdin input, Run in privileged mode)
Now when i run this "Debug Configuration" the container is running (ip 172.17.0.1), gdbserver is connected on Port 2345 and my app is running as webservice listening on port 8166.
I can set breakpoints to the main function and see my webservice-app is listening on Port 8166 inside the container - this is working:-)
But when i want to access from Browser on my Host to Port localhost:8166, 127.0.0.1:8166 or to 172.17.0.1:8166 (representing my WebService-App) this does not work, Browser cannot find something behind this adress/port.
What else i did do:
- I did add a network rule described here (because i saw a docker warning in a logfile => WARNING: IPv4 forwarding is disabled. Networking will not work): https://stackoverflow.com/questions/41453263/docker-networking-disabled-warning-ipv4-forwarding-is-disabled-networking-wil
add the following to /etc/sysctl.conf:
net.ipv4.ip_forward=1
Restarted the whole PC....does not help too:-(
- I did create a new dockerfile with an EXPOSE 8166 statement, so i got a new image which i start within eclipse and i can se now in the Containers View that Port 8116 inside the container is mapped to Host Port 32768...but access to this port does not work too:-( So all of these are not working: localhost:32768, 127.0.0.1:32768 or to 172.17.0.1:32768 - but i get not a "not reachable" message as before, instead i get a endless "wait to connect" message
Hint: When i run the Debug-Configuration-Launcher then in the "Containers Overview" i see on Column "Ports" this "0.0.0.0.:32768->2345/tcp, 8166/tcp"
Any Tip what could be wrong?
|
|
|
|
|
Powered by
FUDForum. Page generated in 5.02900 seconds