Here are the explanations for all the three commands i.e., RUN,CMD and ENTRYPOINT.
RUN :- A Dockerfile can have many RUN steps that layer on top of one another to build the image.
CMD :- It is the command which the container executes by default when you launch the built image. A Dockerfile can only have one CMD. The CMD can be overridden when starting a container with docker run $image $other_command.
ENTRYPOINT :- It is very much similar to CMD and can modify the way a container starts an image.
I hope that the above explanation will resolve your doubts.