Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OCI runtime create failed

I am trying to dockerize a spring boot service. I started referring to this article. I was able to build the image but could not run it. When i try to run the container it fails with below error.

OCI runtime create failed: container_linux.go:345: starting container process caused \"exec: \\"catalina.sh\\": executable file not found in $PATH\": unknown

Command used to build image : docker build --tag=my-image . --no-cache Command used to run container : docker container run -p 8080:8080 my-image

Docker File:

FROM openjdk:8-jdk-alpine
COPY ./target/my-service.war /usr/local/tomcat/webapps/my-service.war
CMD ["catalina.sh","run"]

I am using Windows 10 Docker Desktop and I tried using other base images, reset docker but none of it solve the problem. Please help me with some suggestions.

Regards, Jai

like image 975
Jai Avatar asked Mar 20 '26 02:03

Jai


2 Answers

catalina.sh is from tomcat.

From the article you mentioned in the post, it told you to use:

From tomcat:8.0.51-jre8-alpine
CMD ["catalina.sh","run"]

But, you now use:

FROM openjdk:8-jdk-alpine
CMD ["catalina.sh","run"]

The base image you used do not have tomcat installed, so you certainly could not find catalina.sh.

like image 82
atline Avatar answered Mar 22 '26 18:03

atline


use following command to find catalina.sh

1.docker run -it --rm (ur_image_name) /bin/bash 2./usr/local/tomcat/bin 3.ls

It will list out all file in bin directory.There you will see catalina.sh. Now Copy the whole path of catalina.sh like in my case it is "\usr\local\tomcat\bin\catlina.sh"

and paste this in DockerFile in CMD like this CMD ["\usr\local\tomcat\bin\catlina.sh","run"]

like image 30
Aegon Avatar answered Mar 22 '26 18:03

Aegon