Pergunta de entrevista da empresa Nokia

Difference between CMD and Entrypoint ? What will happen when both CMD and Entrypoint are passed ?

Resposta da entrevista

Sigiloso

1 de fev. de 2021

Both are used for customising the default command in Dockerfile. But CMD can be modified during Run Time, and Entrypoint can be modified during Build Time. So CMD is for customising the container but Entrypoint is for customising the Docker Image. When there are multiple CMDs it only takes the Last one. When both Entrypoint and CMD are there then, CMD will appended to Entrypoint,