You can write only one CMD commands in a Dockerfile. Even, if you write more than one CMD then it will take only the last CMD.
I recommend this Docker Training Online Course by Intellipaat to learn Docker.
Also, you can watch this Docker commands tutorial: