[undertow-dev] Undertow with Docker Port issue
Chris Christo
_c.c at mail.com
Fri Oct 31 08:51:43 EDT 2014
Hi yeah I managed to get it to work. I set undertow server as 172.17.0.65 and it worked. To my understanding, this IP is something docker comes up with and is an internal IP (it's different every time you run a docker container). The external IP is something completely different.
So in summary you must set the host server for undertow as the Internal IP in the Iptables created by docker.
> On 31 Oct 2014, at 19:55, Bernd <ecki at zusammenkunft.net> wrote:
>
> Your iptables do not contain 127.0.0.1 and ::1 as destination?
>
> I would try it without a packet filter first.
>
> Am 31.10.2014 12:51 schrieb "Chris Christo" <_c.c at mail.com>:
>> Hi,
>>
>> Has anyone managed to get undertow working with docker (on CoreOS)?
>>
>> I have a very basic jar that starts up an undertow server on (localhost at port 80) and has a single HttpHandler at the endpoint ‘/hello’. I’ve tested the jar locally and the endpoint works fine.
>>
>> I have a docker file along the lines of:
>>
>> ---------------
>> FROM dockerfile/java:oracle-java8
>>
>> ## wget the app from a server
>>
>> CMD java -jar my-app.jar
>>
>> EXPOSE 80
>> ---------------
>>
>> I then run the container (after building it from the above docker file) as follows:
>>
>> docker run -d -p 80:80 my-app
>>
>> (Yes I made sure the server did start and is running before the following:)
>>
>> I see that the iptables are as follows (which is identical to what dockerfiles/nginx produces):
>>
>> ---------------
>> Chain INPUT (policy ACCEPT)
>> target prot opt source destination
>>
>> Chain FORWARD (policy ACCEPT)
>> target prot opt source destination
>> ACCEPT tcp -- anywhere 172.17.0.65 tcp dpt:http
>> ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
>> ACCEPT all -- anywhere anywhere
>> ACCEPT all -- anywhere anywhere
>>
>> Chain OUTPUT (policy ACCEPT)
>> target prot opt source destination
>> ---------------
>>
>> Finally I try to curl at the ‘/hello’ endpoint but I just get a connection refused. I try the curl request to localhost from within the same server and it doesn’t work. I also try from a different computer using the public IP of the machine and it does’t work.
>>
>> The dockerfile/nginx works perfect when I curl at it at port 80.
>>
>> I’m stumped for ideas, please help!
>>
>> Thanks,
>>
>> Chris
>>
>>
>>
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/undertow-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20141031/d6ab0c37/attachment.html
More information about the undertow-dev
mailing list