With the help of the people here I've been able to successfully get my Docker container containing a Spring Boot application on BlueMix. Now I'm not able to access it.
@LinSun said:
"Hi, thanks for the feedback! We don't currently expose the -p portion for the current time being. The only ports that we expose in containers are : 22,80,443,9080,9443 for public internet access. We are looking at improving this."
So after reading this I made sure my application runs on port 9080 but I don't see any ports listed under ice ps: **-------------------------------------------------------------------------------------------------------------------------------- Container Id Image Id Command Created Status Name Private IP Public IP Priv/Pub Ports
b186629e-901e-4f87 d2cc5071-4a17-4bac Dec 12 09:10 Running linkshorte 172.16.24.69 129.41.248.103
-b508-3df73a365637 -ade2-8183b18d39fc ner
--------------------------------------------------------------------------------------------------------------------------------**
Are there any additional steps needed to expose one of these ports?
You won't see the ports listed from "ice ps", but if you've exposed one of 22, 80, 443, 9080 or 9443 in your Dockerfile and your application is running successfully then it should be reachable via the Public IP.
When I go to http://129.41.248.103:9080 if get:
"Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback."
Which implies its working.
Apparently my work network blocks port 9080. That didn't cross my mind.
Works just fine! Thanks.
Answer by Driss Amri (78) | Dec 12, 2014 at 10:51 AM
The ports 22, 80, 443, 9080 or 9443 can be exposed in the Dockerfile.
Issue was on my side, blocked by network firewall.
@LinSun apparently port 80 is also not working, I switched to 80 but had to revert to 9080 because I couldn't access it.
Answer by RalphB (403) | Dec 15, 2014 at 10:13 AM
The ports 22, 80, 443, 9080 or 9443 are currently the only ones that we are exposing.
If you want more ports then please do drop an email to ice@uk.ibm.com requesting which port with an explanation.
hello Ralph, and in case of node.js shall we have to listen on another port, say 8080 and then do the run switch "-p 9080:8080" ?
Why not just run your node server listening to one of 80, 443, 9080, or 9443? I don't understand why node would be special in this regard.
as defined in ice help run
: --publish PORT, -p PORT expose PORT ...and actually ice ps
lists the port 9080 now, but exposing that port in Dockerfile and making node listen also on it server.listen(9080);
we still have no success, please could you give an hint?
...for some reason it's working now in the morning, maybe there is some delay on the routing enablement :-) thanks anyway
Yes we did have some delay in network, but it should be fixed now. Thanks.
Answer by JeanFrancoisPuget (1) | Jun 05, 2015 at 12:18 PM
A good reason to expose more ports is if you run an app in your container that listens on default ports that are not the ones you expose. An example is IPython notebook servers that listen on port 8888. Your limitation forces us to create a Docker image in which we modify the IPython Notebook server configuration so that it listens to one of the ice exposed ports.
The fix is either to all any TCP port to be exposed, or to allow a port mapping as is possible with the docker client.
Answer by crosen (43) | Sep 21, 2015 at 08:47 AM
You can expose any port number when deploying containers (https://www.ng.bluemix.net/docs/containers/container_single_ov.html#container_single_ui). For a single container deployment, you can expose multiple ports whereas a group deployment is limited to exposing a single port.