Unable to start Spring Boot app using WildFly with debug mode

I am trying to make a docker container holding a simple spring boot app running on WildFly server

I´ve build my Spring Boot app (Which is just freshly initted app with one controller having one method GET /hello which returns a "Hello")

Dockerfile:

FROM jboss/wildfly

## copy your local .war file assumming that this dockerfile is in the same folder as the .war file.
ADD ./target/demo-0.0.1-SNAPSHOT.war /opt/jboss/wildfly/standalone/deployments/demo.war

## adding a user to your JBoss server. Modify the user name and password as needed
RUN /opt/jboss/wildfly/bin/add-user.sh u p --silent

I run docker build --tag=app . to create an image
and then docker run -p 8080:8080 -p 9990:9990 -p 8787:8787 -it app /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0 --debug

Which creates (or should create to be more precise) an container with:

  • with exposed 8080 port (for REST communication)
  • with exposed 9990 port (administration)
  • with exposed 8787 port (for remote debbuging which I will need later), there is an –debug option to standalone script to enable the debugging

Which holds my app on localhost:8080/demo. Therefore I would be able to call GET localhost:8080/demo/hello to get "Hello message" (There is no problem in Spring Boot app, it works perfectly outside the docker)

But I am getting this error:

docker: Error response from daemon: OCI runtime create failed:
container_linux.go:349: starting container process caused "exec:
"./opt/jboss/wildfly/bin/standalone.sh": stat
./opt/jboss/wildfly/bin/standalone.sh: no such file or d irectory":
unknown.

Source: Docker Questions