What is the difference between RUN and CMD in a Dockerfile?
Note: Don’t confuse RUN with CMD. RUN actually runs a command and commits the result; CMD does not execute anything at build time, but specifies the intended command for the image. 

reference