Need Assistance?

support@tutorialshub.in

Docker Images and Dockerfiles

CMD and ENTRYPOINT

ADVERTISEMENT
Docker Free Lesson
5 min read
ADVERTISEMENT

Defining the Container Process

CMD supplies the default command or arguments. ENTRYPOINT defines the executable that the container is intended to run. The JSON exec form is generally preferable because it avoids an extra shell process and preserves signals correctly.

A common pattern is an executable ENTRYPOINT with CMD providing default arguments. Remember that a container should normally have one clear foreground process responsible for its lifecycle.

ADVERTISEMENT