I have a folder structure as shown below
. ├── docker-compose.yml └── web-app ├── create_tomcat_admin.sh ├── Dockerfile ├── pom.xml └── run.sh
And my docker-compose.yml is like
version: '3' services: web-app: build: context: . dockerfile: web-app/Dockerfile ports: - 8080:8080 network_mode: "host"
As soon as I execute docker-compose build , it runs fine and in the terminal it displays as below
Step 10/15 : ADD /web-app/create_tomcat_admin_user.sh /create_tomcat_admin_user.sh ---> Using cache ---> 6ca9922b3628 Step 11/15 : ADD /web-app/run.sh /run.sh ---> Using cache ---> c1e843f2f67a Step 12/15 : RUN chmod +x /*.sh ---> Using cache ---> 6b8e781b830c Step 13/15 : COPY /web-app/target/*.war /tomcat/webapps ---> Using cache ---> fc046d9d1d3e Step 14/15 : EXPOSE 8080 ---> Using cache ---> 68f788c21a84 Step 15/15 : CMD /run.sh ---> Using cache ---> d88cc5594980 Successfully built d88cc5594980 Successfully tagged opt_web-app:latest`
after creating docker-compose, when I execute docker-compose up it gives an error
ben@ubuntu :~/Desktop/opt$ docker-compose up Starting opt_web-app_1 Attaching to opt_web-app_1 web-app_1 | standard_init_linux.go:187: exec user process caused "no such file or directory" opt_web-app_1 exited with code 1 ben@ubuntu :~/Desktop/opt$
Where am I going wrong? But should the error be displayed when building docker-compose.yml to the right?
source share