{"action":"created","issue":{"url":"https://api.github.com/repos/Shippable/support/issues/2639","repository_url":"https://api.github.com/repos/Shippable/support","labels_url":"https://api.github.com/repos/Shippable/support/issues/2639/labels{/name}","comments_url":"https://api.github.com/repos/Shippable/support/issues/2639/comments","events_url":"https://api.github.com/repos/Shippable/support/issues/2639/events","html_url":"https://github.com/Shippable/support/issues/2639","id":156085240,"number":2639,"title":"Client-Server Program Using Socker API in C++ Is not Able to Communicate over Docker","user":{"login":"vikasr04","id":19500672,"avatar_url":"https://avatars.githubusercontent.com/u/19500672?v=3","gravatar_id":"","url":"https://api.github.com/users/vikasr04","html_url":"https://github.com/vikasr04","followers_url":"https://api.github.com/users/vikasr04/followers","following_url":"https://api.github.com/users/vikasr04/following{/other_user}","gists_url":"https://api.github.com/users/vikasr04/gists{/gist_id}","starred_url":"https://api.github.com/users/vikasr04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikasr04/subscriptions","organizations_url":"https://api.github.com/users/vikasr04/orgs","repos_url":"https://api.github.com/users/vikasr04/repos","events_url":"https://api.github.com/users/vikasr04/events{/privacy}","received_events_url":"https://api.github.com/users/vikasr04/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-21T05:31:43Z","updated_at":"2016-05-21T18:24:02Z","closed_at":null,"body":"Issue:\r\nI have a Server program written in C++ ,using posix Socket API. The Dockerfile used for building the Server image is:\r\n$ cat Dockerfile\r\nFROM gcc:4.9\r\nWORKDIR /home/vikrana\r\nCOPY . .\r\nEXPOSE 1001\r\nRUN g++ -o testcplusplus testprogram.cpp\r\nENV PATH /home/vikrana:$PATH\r\nENTRYPOINT [\"testcplusplus\", \"1001\"]\r\n\r\nBelow is the link for the Server program written in C++.\r\n[testprogram.txt](https://github.com/Shippable/support/files/275715/testprogram.txt)\r\n\r\nFollowing is the Docker command I am using to run my server program in the container:\r\n$ docker run --net=user_def_nw -ti -P --name server1 my-server-app\r\n\r\nOn running above command the container gets attached with user_def_nw and an IP address \"172.18.0.2\" is assigned to the container, which is always is the case. The same IP address I have used in my server program cpp file.\r\n\r\nOn the other hand following are the details of my Client program written in C++ using posix Socket API.\r\nDockerFile to create client image:\r\n$ cat Dockerfile\r\nFROM gcc:4.9\r\nWORKDIR /home/vikrana\r\nCOPY . .\r\nRUN g++ -o testcplusplus testclientprogram.cpp\r\nENV PATH /home/vikrana:$PATH\r\nENTRYPOINT [\"testcplusplus\", \"172.18.0.2\", \"1001\"]\r\n\r\nBelow is the link for the Client program:\r\n[testclientprogram.txt](https://github.com/Shippable/support/files/275722/testclientprogram.txt)\r\n\r\nFollowing is the Docker command I am using to run my client program in the container:\r\n$ docker run --net=user_def_nw -ti  --name cli1 my-client-app\r\n\r\nOn running the above command it is noticed Client is not able to connect to the server at IP: 172.18.0.2 listening at port 1001.\r\n\r\nThe error code return my the connect API is \"111\" which means, connection refused.\r\n\r\nCan anyone help me in resolving this issue in Docker.?\r\n\r\nThanks in Advance.\r\n"},"comment":{"url":"https://api.github.com/repos/Shippable/support/issues/comments/220793038","html_url":"https://github.com/Shippable/support/issues/2639#issuecomment-220793038","issue_url":"https://api.github.com/repos/Shippable/support/issues/2639","id":220793038,"user":{"login":"manishas","id":2983749,"avatar_url":"https://avatars.githubusercontent.com/u/2983749?v=3","gravatar_id":"","url":"https://api.github.com/users/manishas","html_url":"https://github.com/manishas","followers_url":"https://api.github.com/users/manishas/followers","following_url":"https://api.github.com/users/manishas/following{/other_user}","gists_url":"https://api.github.com/users/manishas/gists{/gist_id}","starred_url":"https://api.github.com/users/manishas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manishas/subscriptions","organizations_url":"https://api.github.com/users/manishas/orgs","repos_url":"https://api.github.com/users/manishas/repos","events_url":"https://api.github.com/users/manishas/events{/privacy}","received_events_url":"https://api.github.com/users/manishas/received_events","type":"User","site_admin":false},"created_at":"2016-05-21T18:24:02Z","updated_at":"2016-05-21T18:24:02Z","body":"@vikasr04 is this a for a project you've enabled on Shippable?\r\n\r\nIf yes, can you please share the username you use to sign in to Shippable?"}}
{"actor":{"display_login":"manishas"}}