I have folder structure like 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"
Once i execute docker-compose build it executes perfectly and in terminal it shows like 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 building docker-compose, when i execute docker-compose up it is giving 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 i am going wrong? But error should be displayed while building docker-compose.yml right?