I'm trying to write a dockerfile which calls an entrypoint. However, I'm really confused why these three things are different.
The first doesn't work:
ENTRYPOINT [ "python detect.py --weights /model/yolov5s.pt --source /videos --project /outputs --class 1 2 3 4 5 6 7 9 10 11 12 --save-crop --conf-thres=.7" ]
And the second doesn't work:
ENTRYPOINT [ "python", "detect.py", "--weights /model/yolov5s.pt", "--source /videos", "--project /outputs", "--class 1 2 3 4 5 6 7 9 10 11 12", "--save-crop", "--conf-thres=.7" ]
But the third one does:
ENTRYPOINT [ "python", "detect.py", "--weights","/model/yolov5s.pt", "--source","/videos","--project","/outputs","--class","1","2","3","4","5","6","7","9","10","11","12","--save-crop","--conf-thres=.7" ]
Why?
From the documentation, you can see that ENTRYPOINT has two forms:
ENTRYPOINT ["executable", "param1", "param2"]
(the exec form)ENTRYPOINT command param1 param2
(the shell form)Either way, the arguments passed to it, need to be separated (similar to your third example).
Since your examples are using the exec form, you can see why only your third example works.