catalina.sh not found, having trouble on Docker run

Hello, this is first time I was trying to build and run docker image. Yesterday, I was able to deploy my Spring MVC web application into App Engine successfully, and that was impressing for me. Now I want to build docker image out of it and run, then deploy it into Kubernetes. I can deploy only ready-to-use images into kubernetes, but I want to build my own image and do the same.

This is the trace and error at the end.

Sending build context to Docker daemon 23.87MB
Step 1/5 : FROM tomcat:8.0-alpine
8.0-alpine: Pulling from library/tomcat
4fe2ade4980c: Already exists
6fc58a8d4ae4: Already exists
7d9bd64c803b: Already exists
a22aedc5ac11: Already exists
5bde63ae3587: Already exists
69cb0c9b940a: Already exists
Digest: sha256:d02a16c0147fcae13d812fa670a4b3c9944f5328b10a5a463ad697d2aa5bb063
Status: Downloaded newer image for tomcat:8.0-alpine
—> 624fb61775c3
Step 2/5 : LABEL maintainer=”fuadmonsoon”
—> Running in b7ead5e3911d
Removing intermediate container b7ead5e3911d
—> 77406736235f
Step 3/5 : ADD springmvc-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/
—> bd0efe605484
Step 4/5 : EXPOSE 8080
—> Running in cb7fedfa14f4
Removing intermediate container cb7fedfa14f4
—> 81970d32cc53
Step 5/5 : CMD [“/opt/tomcat/bin/catalina.sh”, “run”]
—> Running in 261f4a84fda5
Removing intermediate container 261f4a84fda5
—> 16ffc4645ad8
Successfully built 16ffc4645ad8
Successfully tagged anan:latest

As it seems from log, all steps completed successfully when I build. But when I run “docker run anan” command, it gives this error:

/bin/sh: [“/opt/tomcat/bin/catalina.sh”,: not found (Honestly I also wonder why it prints only opening of square parentheses. This is my Dockerfile below:

FROM tomcat:8.0-alpine
LABEL maintainer=”fuadmonsoon”
ADD springmvc-1.0-SNAPSHOT.war /usr/local/tomcat/webapps/
EXPOSE 8080


CMD [“/opt/tomcat/bin/catalina.sh”, “run”]





it was “CMD [“catalina.sh”, “run”]” before, I changed it to try either way, but no luck. Maybe you know some images other than tomcat alpine suitable for my java spring application, I’d want to give it a try. Thanks in advance.

A wild guess made by looking in the docker file for Tomcat found here:

https://github.com/docker-library/tomcat/blob/03f14ce800144d7d76a2212ced95b44410273c3a/10.0/jdk16/openjdk-buster/Dockerfile

Maybe try:

CMD [“/usr/local/tomcat/bin/catalina.sh”, “run”]

Failing that, try and start the image using /bin/bash as a shell and login to it. From there, go surf the file systems looking for catalina.sh and validate that it is where you think it is.