The exec form is Dockerfile syntax that invokes an ENTRYPOINT or CMD executable directly, without starting a shell. For example: ENTRYPOINT ["/myexecutable", "1st-arg", "2nd-arg"]. The executable becomes the container’s root process. section 6.3.2
This process relationship matters when a container receives SIGTERM. With exec form, the application receives the signal directly. With shell form, the shell becomes the root process and may not pass SIGTERM to its child application, so replacing shell form is usually preferable to adding a signal-sending pre-stop hook. section 6.3.2
Direct versus shell invocation
Exec form: ENTRYPOINT ["/myexecutable", "1st-arg", "2nd-arg"]. Shell form: ENTRYPOINT /myexecutable 1st-arg 2nd-arg. If a shell script starts the application instead, the script must forward signals or use the exec shell command. section 6.3.2
