The CMD form WITHOUT [ and ] is implicitly run inside sh, which means it does variable replacement. If you add the brackets, it becomes the "exec" form which is NOT implicitly run inside a shell (and won't do variable replacement or && expansion). We should make it ultra-clear to users by explicitly specifying ["sh", "-c", "the_command and some args"] so users can clearly see what's going on.
The CMD form WITHOUT
[
and]
is implicitly run insidesh
, which means it does variable replacement. If you add the brackets, it becomes the "exec" form which is NOT implicitly run inside a shell (and won't do variable replacement or&&
expansion). We should make it ultra-clear to users by explicitly specifying["sh", "-c", "the_command and some args"]
so users can clearly see what's going on.