Shell form ENTRYPOINT example
You can specify a plain string for theENTRYPOINTand it will execute in/bin/sh -c.
This form will use shell processing to substitute shell environment variables,
and will ignore anyCMDordocker runcommand line arguments.
To ensure thatdocker stopwill signal any long runningENTRYPOINTexecutable
correctly, you need to remember to start it withexec:
When you run this image, you'll see the singlePID 1process:
Which exits cleanly ondocker stop:
If you forget to addexecto the beginning of yourENTRYPOINT:
You can then run it (giving it a name for the next step):
You can see from the output oftopthat the specifiedENTRYPOINTis notPID 1.