Bluemix very slow to start Spring Boot application, hangs

I am trying to deploy a simple Spring Boot application to Bluemix using Docker image.
The image is based on dockerfile/java:oracle-java8 and runs perfectly find on my local Linux VM – it starts within 10-30 seconds.
However the Blumix container running the same image in the cloud takes more than 10 minutes to start. The Bluemix console page shows status as Running, but there is no progress (judging by logs) for the past 10 minutes. I get following log (notice the time intervals) using the sudo ice logs -o myContainer command:

Target is container cloud. Invoking cloud service...

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
[32m :: Spring Boot :: [39m      [2m (v1.2.1.RELEASE)[0;39m

[2m2015-02-04 21:07:49.006[0;39m [32m INFO[0;39m [35m1[0;39m [2m---[0;39m [2m[           main][0;39m [36mcom.dash.nlpHighlight.web.App           [0;39m [2m:[0;39m Starting App with PID 1 (/opt/highlighter/highlighter-0.0.1.jar started by root in /opt/highlighter)
[2m2015-02-04 21:07:49.057[0;39m [32m INFO[0;39m [35m1[0;39m [2m---[0;39m [2m[           main][0;39m [36mationConfigEmbeddedWebApplicationContext[0;39m [2m:[0;39m Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@5aa60e57: startup date [Wed Feb 04 21:07:49 UTC 2015]; root of context hierarchy
[2m2015-02-04 21:07:52.773[0;39m [32m INFO[0;39m [35m1[0;39m [2m---[0;39m [2m[           main][0;39m [36mo.s.b.f.s.DefaultListableBeanFactory    [0;39m [2m:[0;39m Overriding bean definition for bean 'beanNameViewResolver': replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]

Using sudo ice inspect myContainer i get:

  • Jenkins: Don't want to trigger on Git Tag (No Workspace)
  • Best workflow for developing and debugging - initially deploy in a docker environment
  • How can I disable TLS when running from Docker?
  • Docker in Vagrant issuing : Warning: Connection refused. Retrying
  • Tensorflow linear classifier. I can't run it on Docker
  • could not read Username for 'https://github.com': No such device or address
  • Target is container cloud. Invoking cloud service...
    {
        "Config": {
            "AttachStderr": "",
            "AttachStdin": "",
            "AttachStdout": "",
            "Cmd": [
                "date"
            ],
            "Dns": "",
            "Env": {
                "group-id": "0000",
                "space-id": "5588d535-a208-4cd2-be05-db781af48ada",
                "tagformat": "space-id group-id uuid",
                "tagseparator": "_"
            },
            "Hostname": "",
            "Image": "registry-ice.ng.bluemix.net/myOrg/myImage:latest",
            "Memory": 256,
            "MemorySwap": "",
            "OpenStdin": "",
            "PortSpecs": "",
            "StdinOnce": "",
            "Tty": "",
            "User": "",
            "VCPU": 1,
            "Volumes": [],
            "VolumesFrom": "",
            "WorkingDir": ""
        },
        "Created": "2015-02-04T21:35:17Z",
        "HostConfig": {
            "Binds": "null",
            "CapAdd": [],
            "CapDrop": [],
            "ContainerIDFile": "",
            "Links": [],
            "LxcConf": [],
            "PortBindings": {},
            "Privileged": "false",
            "PublishAllPorts": "false"
        },
        "HostId": "c4cc40876ba4db63069eb35d061670783146287b3d9ca5155dedf1be",
        "Human_id": "myContainer",
        "Id": "fa15e14d-ffe2-4621-b81a-579a60b52936",
        "Image": "ecbb9431-822e-4e74-8a04-5b942743a42c",
        "Name": "myContainer",
        "NetworkSettings": {
            "Bridge": "",
            "Gateway": "",
            "IpAddress": "172.16.46.71",
            "IpPrefixLen": 0,
            "PortMapping": "null",
            "PublicIpAddress": "129.41.249.63"
        },
        "Path": "date",
        "ResolvConfPath": "/etc/resolv.conf",
        "State": {
            "ExitCode": "",
            "Ghost": "",
            "Pid": "",
            "Running": "true",
            "StartedAt": "",
            "Status": "Running"
        },
        "Volumes": []
    }
    

    Initially I started the container using ice run myContainer myImage. I stopped and started the container, but it did not solve the problem.

    Here are the contents of the Docker file:

    FROM dockerfile/java:oracle-java8
    ADD myJar-0.0.1.jar /opt/myFolder/
    ADD application.properties /opt/myFolder/
    EXPOSE 8080
    WORKDIR /opt/myFolder/
    CMD ["java", "-jar", "-Xmx1500m", "myJar-0.0.1.jar"]
    

  • What are the minimum requirements of neo4j?
  • How to dockerize a node.js talking to a local mongodb
  • Cannot connect to localhost with Rocketchat on Docker
  • Can't find logs in Elastic search docker container
  • Rancher Docker container UI unreacheable on 8080 port
  • Update docker version where containers are running
  • One Solution collect form web for “Bluemix very slow to start Spring Boot application, hangs”

    It looks like there is an issue with binding a port to your app.

    In your Dockerfile you need the following.

    EXPOSE

    Where port is 22, 80, 443, 9080, or 9443.

    Additionally you need to define a command to start your app.

    CMD[“….”]

    This is from step 6 from https://www.ng.bluemix.net/docs/#services/Containers/index.html.

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