0

I have a REST web service built using akka-http. I have created a Docker image of the same, and it runs on the local system. When I upload the Docker image on IBM bluemix, the image is pushed successfully, but when I try to create a container for that image, it gets stuck on the status:

Starting container" for quite long (waited for over 45 mins) and does not get to the status: "Running".

I have attached the Docker file for reference. How do I get the container running?

Docker file:

FROM registry.ng.bluemix.net/ibmliberty:latest
USER root
RUN mkdir -p /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-actor_2.11-2.3.14.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-http-core-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-http-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-http-spray-json-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-http-xml-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-parsing-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-stream-experimental_2.11-1.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/akka-testkit_2.11-2.3.14.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/config-1.2.1.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/db2jcc4-10.1.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/reactive-streams-1.0.0.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/scala-library-2.11.7.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/spray-json_2.11-1.3.1.jar /opt/ibm/lib
COPY ./out/artifacts/studentsservice_jar/studentsservice.jar /opt/ibm/lib
EXPOSE 9080
CMD ["java", "-jar", "/opt/ibm/lib/studentsservice.jar"]
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Dreams
  • 5,854
  • 9
  • 48
  • 71
  • I don't know bluemix, anyway I would try to override the CMD with /bin/bash (docker run -d -ti myImage /bin/bash), then if the container starts, try to connect it (docker exec -ti containerId /bin/bash) and to run your command from container prompt (java -jar /opt/ibm/lib/studentsservice.jar) – gile Jan 21 '17 at 01:24
  • Thanks for the suggestion @gile . I also tried doing that. But there was an error with address binding. I am trying to resolve that. But, overriding the CMD seems like a work around. In principle, it should work otherwise as well. So, trying out different things :) – Dreams Jan 23 '17 at 03:41
  • 1
    I agree with you. The suggestion to override the CMD was just to debug the container. – gile Jan 23 '17 at 07:39
  • For the container while it's starting - are there any useful logs from the `cf ic logs containername` command? Might be able to see if it's actually getting into the cmd itself. – N Fritze Jan 23 '17 at 14:23
  • @NFritze - there are no logs which may be helpful. I think its because the container is yet to start. – Dreams Jan 25 '17 at 05:36
  • Hmm. Another possibility is that sometimes the `cf ic inspect containername` command will show why a container failed to start (or possibly that it started and exited). What state is the container going into? (is it staying in "Building", or going to "Shutdown"?) – N Fritze Jan 25 '17 at 16:11
  • @NFritze - Sorry for the delay. It stays in "Building". But I was able to start the container when I made an Uber jar and running a shell script which runs the jar by going in /bin/bash. Thanks for your time – Dreams Jan 30 '17 at 10:02
  • Odd. it's working now, though? almost sounds like it had an issue kicking off the start/java command, but didn't expose that. – N Fritze Feb 07 '17 at 16:03
  • @NFritze - Maybe, but ya it worked now! Thanks for the suggestions :) – Dreams Feb 15 '17 at 10:27

0 Answers0