0

I am following 'kubernetes-for-java-developers' Arun gupta's tutorial for learning docker/kubernetes.

https://github.com/arun-gupta/kubernetes-for-java-developers

I am failing in this particular step

docker image build --file Dockerfile.jre -t arungupta/greeting:jre-slim .

while I am using docker desktop, windows container, getting below messege.

F:\Work\Workspace\IntellejIdea\kubernetes-for-java-developers\app>docker
image build --file Dockerfile.jre -t arungupta/greeting:jre-slim .
Sending build context to Docker daemon  219.5MB 
Step 1/7 : FROM debian:9-slim 
operating system is not supported

while I am using docker desktop, linux container, getting below messege on running below command

docker container run -d -p 8090:8080 arungupta/greeting:jre-slim

F:\Work\Workspace\IntellejIdea\kubernetes-for-java-developers\app>docker container run -d -p 8090:8080 arungupta/greeting:jre-slim
db92a3cc25635d1d2a7f02cd7c94dd11af6b17ea5b258dcaf740de93a05221f7
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"./myjre/bin/java\": stat ./myjre/bin/java: no such file
or directory": unknown.

My operating system is windows 10 pro.

Dockerfile.jre

FROM debian:9-slim

COPY target/app.war /root
COPY myjre /root/myjre

EXPOSE 8080 5005
WORKDIR /root
ENV _JAVA_OPTIONS '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
CMD ["./myjre/bin/java", "-jar", "app.war"]

As I am new on this docker/kubernetes technology, not sure where to start debugging, or the issues.

help appreciated!!

barun
  • 393
  • 1
  • 5
  • 19
  • change `CMD ["./myjre/bin/java", "-jar", "app.war"]` to `CMD ["/root/myjre/bin/java", "-jar", "app.war"]` and i guess you also need to add JDK to slim version of debian – Gaurav Feb 11 '19 at 02:18
  • I tried using `CMD ["/root/myjre/bin/java", "-jar", "app.war"]` it didn't work, getting same response. note, I am using custom jre. `COPY myjre /root/myjre` I am not sure if I need to add jdk. – barun Feb 11 '19 at 02:21
  • see the Docker file, app.jar is in root directory and workdir is also root directory. – barun Feb 11 '19 at 02:26
  • In both copy command you need to add a backward slash at end `COPY myjre /root/myjre/` – Gaurav Feb 11 '19 at 02:29
  • I have created the jre for windows platform, but the target platform is linux, could this be an issue? Tomorrow I will create a jre for linux and try to create the image. – barun Feb 11 '19 at 05:10
  • I guess window 10 only supports that because recently there was update by microsoft. If you are 10 user https://blog.docker.com/2017/09/preview-linux-containers-on-windows/ see this. It will help you – Gaurav Feb 11 '19 at 06:07
  • 1
    Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/188199/discussion-between-gaurav-and-barun). – Gaurav Feb 11 '19 at 06:10

0 Answers0