Dockerfile cmd bash

docker entrypoint vs cmd 1 docker run vs cmd 2 entrypoint docker 3 Linux — > bash (/bin/bash -c); 4 Since that CMD uses JSON-array syntax, there isn't directly a shell-syntax equivalent of it. The shell syntax automatically inserts a sh -c wrapper around whatever command you give it, so these two would be equivalent. CMD bash CMD ["/bin/sh", "-c", "bash"] There would not be an equivalent docker exec command. 5 CMD ["param1","param2"] (exec form, as default parameters to ENTRYPOINT) CMD command param1 param2 (shell form) There can only be one CMD instruction in a Dockerfile. If you list more than one CMD, only the last one takes effect. The purpose of a CMD is to provide defaults for an executing container. 6 7 8 Discover the power of the Docker run command and learn how to effectively manage and run Docker containers. 9 Learn essential Docker exec techniques 10 If no command is specified during the container startup (i.e., in the docker run command), this default is used. 12