A few rules applied when using Entrypoint and CMD
docker run imagename overwrite-cmd-here
--entrypoint
its a bit harder than CMDTo allow user pass in commandline argument during docker run
Dockerfile
FROM alpine:3.10
ENTRYPOINT ["ls"]
Commandline
docker run --rm sample
bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
docker run --rm sample /usr
bin lib local sbin share
Same technique can be use by having a script as entrypoint and pass overwrite cmd as the way to pass argument in for the entrypoint script
References