Assume I have a base image with entrypoint/cmd, and a new layer built upon it also has an entrypoint/cmd.
For example:
Base:
entrypoint ["base-start.sh"]
cmd ["-initialize"]
Assume they will output a timestamp and a message like
2018-08-31 15:00:00 base image initializing(2 min remaining).
2018-08-31 15:02:00 base image initialized.
New layer:
cmd /layer-start.sh
Assume output:
2018-08-31 15:00:00 layer cmd executed.
Now I'd like to know would they both be executed and if they do, what is the execution order?
Which one is the result?
Base cmd and layer cmd start in parallel.
2018-08-31 15:00:00 base image initializing(2 min remaining). 2018-08-31 15:00:00 layer cmd executed. 2018-08-31 15:02:00 base image initialized.
Layer cmd start after base cmd exits.
2018-08-31 15:00:00 base image initializing(2 min remaining). 2018-08-31 15:02:00 base image initialized. 2018-08-31 15:02:01 layer cmd executed.
Base image cmd is overriden.
2018-08-31 15:00:00 layer cmd executed.
And if base image use cmd directly instead of entrypoint + cmd, would the senario be different?
Thank you in advance.