Solace Community is getting a facelift!
On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.
We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!
Automatically run cli script during/after docker startup
Hello,
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 *.sql
, *.sql.gz
, or *.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.
[...] (postgres - Official Image | Docker Hub)
We are aware that we can execute the CLI scripts either manually inside the instance or from the outside through docker exec.
Greetings,
Filip.
Best Answer
-
Hi @jfg1306,
There is currently not a way to automatically run CLI scripts, but I always thought it would be a cool feature so if you feel strongly about it please request it via support ;)
As it stands, two common options for configuration are triggering the scripts as you have noted, or using SEMP to perform your configuration. Either way I'd recommend a SEMP call before executing either to check that the container is up and running :)
0
Answers
-
Hi @jfg1306,
There is currently not a way to automatically run CLI scripts, but I always thought it would be a cool feature so if you feel strongly about it please request it via support ;)
As it stands, two common options for configuration are triggering the scripts as you have noted, or using SEMP to perform your configuration. Either way I'd recommend a SEMP call before executing either to check that the container is up and running :)
0