DOCKER| ENTRYPOINT vs. CMD

O.K…. Lets start. ;)

Variables passed as arguments to the container using -e will be part of containers environment.

ENTRYPOINT script will be executed using this environment. Any CMD will be passed as an argument to the running ENTRYPOINT script.

If there is no ENTRYPOINT defined, CMD will be executed instead.

In other words:

ENTRYPOINT + CMD => $($ENTRYPOINT $CMD)
CMD => $($CMD)
ENTRYPOINT + CMD + CONTAINERARGS => $($ENTRYPOINT $CMD) with ENV_CONTAINERARGS
CMD + CONTAINERARGS => $($CMD) with ENV_CONTAINERARGS
ENTRYPOINT + CONTAINERARGS => $($ENTRYPOINT) with ENV_CONTAINERARGS
ENTRYPOINT => $($ENTRYPOINT)
CONTAINERARGS => NOTHING
NOTHING => NOTHING

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.