[undertow-dev] Undertow with Docker Port issue

Chris Christo _c.c at mail.com
Fri Oct 31 07:50:58 EDT 2014


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





More information about the undertow-dev mailing list