CMD specifies the default command to run inside the container. Only one CMD instruction is effective — the last one wins (including CMD in parent images).
If ENTRYPOINT is defined, CMD provides default arguments to the entrypoint (use exec form in that case).
Arguments passed to docker run after the image name override CMD. The command runs at container initialization.
Andrew Dorokhov