Automatically run cli script during/after docker startup
is there a place or option somewhere that allows us to automatically run CLI scripts right after the startup completed ?
The idea comes from PostgreSQL where you can create .sql files and place them in a specific path (here initdb.d) and they will get automatically executed.
If you would like to do additional initialization in an image derived from this one, add one or more
*.sh scripts under
/docker-entrypoint-initdb.d (creating the directory if necessary). After the entrypoint calls
initdb to create the default
postgres user and database, it will run any
*.sql files, run any executable
*.sh scripts, and source any non-executable
*.sh scripts found in that directory to do further initialization before starting the service.
We are aware that we can execute the CLI scripts either manually inside the instance or from the outside through docker exec.