CMD and ENTRYPOINT are instructions given in the dockerfile.
The main purpose of a CMD is to provide defaults for an executing container. These defaults can include an executable, or they can omit the executable, in which case you must specify an ENTRYPOINT instruction as well.
For more details check
https://docs.docker.com/engine/reference/builder/