[undertow-dev] Undertow with Docker Port issue

lanabe lanabe.lanabe at gmail.com
Fri Oct 31 08:44:54 EDT 2014


Hi, Chris.

> localhost at port 80

Could you change localhost to 0.0.0.0(or youe Docker container IP Address)
at addHttpLIstner in your app?


On Fri, Oct 31, 2014 at 8:55 PM, 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
>>
>
> _______________________________________________
> 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/7a1d6989/attachment-0001.html 


More information about the undertow-dev mailing list