I have built a docker image from the following Dockerfile
:
FROM cdi_monitoring:monitoring
ENTRYPOINT ["/bin/ash","-c","/entry.sh","/32ULC_subset"]
The cdi_monitoring is another image that I am extending and that is working properly. The path to my working directory is /home/casper/Downloads/data/32ULC_subset
.
Now when I try to run the image built above I get the error /32ULC_subset: line 1: /entry.sh: not found
.Here is how I am running the Dockerfile:
sudo docker run --name cdi_monitoring --rm -it -v /home/casper/Downloads/data/32ULC_subset/:/home/casper/Downloads/data/32ULC_subset/ cdi_monitoring:wrapper ./ChangeDetectionIL /home/casper/Downloads/data/32ULC_subset/ /home/casper/Downloads/data/32ULC_subset/Konfiguration_CD/IL_Liste.txt /home/casper/Downloads/data/32ULC_subset/Konfiguration_CD/
How can i fix this issue?
Well it seems you have path issues.
What is the location of your file entry.sh ? Is it really located at root path (i.e : /) ?
If not, you have two solutions. For the example, suppose your file is located in /home/casper/Downloads/data
, then :
ENTRYPOINT
and give the full pathFROM cdi_monitoring:monitoring
ENTRYPOINT ["/bin/ash","-c","/home/casper/Downloads/data/entry.sh","/home/casper/Downloads/data/32ULC_subset"]
WORKDIR
before the ENTRYPOINT
FROM cdi_monitoring:monitoring
WORKDIR /home/casper/Downloads/data
ENTRYPOINT ["/bin/ash","-c","./entry.sh","./32ULC_subset"]