Commit 499f67d1 authored by mohammad.salama's avatar mohammad.salama

the main difference between CMD and ENTRYPOINT is added

parent 7c0b4514
ENTRYPOINT is the process that’s executed inside the container.
CMD is the default set of arguments that are supplied to the ENTRYPOINT process.
CMD is easily overridden by appending your own arguments to the docker run command.
when wwe don't use ENTRYPOINT , it is set to default value : /bin/sh -c
so it is very important in many scenarios:
let's say we have an image in a certain directory there is the application we want to start.
each application has a unique argument(s) to pass (port number , credentials , commands ...)
then we set entry point to the path of the app to start it (execute it).
then in cmd we specify the arguments we want to pass.
so if we need to change the arguments according to our needs we only need to modify them in the 'docker run' command.
which makes the containers more flexible.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment