502 error when viewing Java liberty Bluemix application using Docker container

I created a Java Liberty application on Bluemix and cloned the sample code from the JazzHub Git repository linked to the application.
I then copied the JavaHelloWorldApp.war file to the base directory of the sample code and created a Dockerfile with the following text:

FROM registry.ng.bluemix.net/ibmliberty:javaee7
ADD JavaHelloWorldApp.war /opt/ibm/wlp/usr/servers/defaultServer/dropins/

I set up the DevOps pipeline to build an image and then create a container following this example Node.js application: https://hub.jazz.net/deploy/index.html?repository=https://github.com/Puquios/hello-containers

  • Unable to connect with container running in multiple host (Destination Host unreachable) [closed]
  • Installation of Kubernetes-node fails with conflicting packages on CentOs 7
  • Options -Indexes not working in .htaccess file in Docker continer
  • Docker swarm version upgrade without causing downtime
  • How to execute the Entrypoint of a Docker images at each “exec” command?
  • Setting docker ip and port prevents me from using docker ps -a
  • The application successfully builds and deploys, however I receive the following error when I go to view the url for the new container application:

    502 Bad Gateway: Registered endpoint failed to handle the request.

    How do I fix this?

  • Unrecognized import path “main/testPackage” when running Go image
  • Laradock + Webpack + Hot-reload
  • vagrant: Run shell script in Virtualbox after Docker instances boot (ordering is wrong)
  • Docker build leads to “no space left on device” on Windows 10
  • Saving changes in docker project
  • How to list docker swarm nodes with lables
  • One Solution collect form web for “502 error when viewing Java liberty Bluemix application using Docker container”

    A 502 error means that the router can not get a response from the container in your group. There are two possible causes for this:

    1. Your container is not responding or
    2. There is a routing error and your container is running fine.

    To test #1, you will need to use cf ic to bind an IP address to the running container and then curl against that IP address:port to see if the container is responding.


    1. Install cf and the cf ic plugin if needed.
    2. cf login
    3. cf ic login
    4. cf ic ps

      — this will give you the container ID. If you have multiple running containers you can do a cf ic inspect [container-ID] to see which one is in your group. It will also display the port

    5. cf ic ip request

      — this will give you an IP address

    6. cf ic ip bind [IP address] [container-ID]

    Now go to the [IP address]:[port] and see if you can access your application.

    If you can access your application via IP address let me know and I can follow-up with the router problem.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.