Creating an entrypoint script

The Docker ENTRYPOINT directive configures the very first command or script that is executed by the container. When configured in conjunction with the CMD directive, the ENTRYPOINT command or script is executed, with the CMD commands passed as arguments to the entrypoint script. This establishes a very common pattern of an entrypoint performing initialization tasks such as injecting secrets into the environment, which then invokes the application based on the command arguments passed to the script.

The following example demonstrates creating an entrypoint script for the todobackend sample application, that you should place in the root of the todobackend repository:

> pwd/Users/jmenga/Source/docker-in-aws/todobackend ...

Get Docker on Amazon Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.