Exec form ENTRYPOINT example
You can use the exec form ofENTRYPOINTto set fairly stable default commands
and arguments and then use either form ofCMDto set additional defaults that
are more likely to be changed.
When you run the container, you can see thattopis the only process:
To examine the result further, you can usedocker exec:
And you can gracefully requesttopto shut down usingdocker stop test.
The following Dockerfile shows using theENTRYPOINTto run Apache in the
foreground (i.e., asPID 1):
If you need to write a starter script for a single executable, you can ensure that
the final executable receives the Unix signals by usingexecandgosucommands: