create user from bash after rabbitmq server starts

313 views
Skip to first unread message

Ishvar B

unread,
Dec 21, 2021, 6:58:55 AM12/21/21
to rabbitmq-users
Hi All,

Any help/suggestion is highly appreciated.

I have running rabbitmq on docker using docker compose. I have a bash script that creates user, vhosts, set permissions after the container starts. Now, I have the bash to be a part of rabbitmq startup script but could not get around as the moment. My dockerfile looks like

FROM rabbitmq:3.8.5-management-alpine
COPY scripts/ scripts/

RUN ls -l scripts/
RUN chmod +x scripts/setup.sh

ENTRYPOINT ["/bin/sh", "-c", "  /usr/local/bin/docker-entrypoint.sh rabbitmq-server && scripts/setup.sh"]

My intention is to run the startup script after the entrypoint script completes. But when rabbitserver starts, the processing stops and the second part (setup.sh is ignored)

Thanks
Eswar

Michal Kuratczyk

unread,
Dec 21, 2021, 7:12:35 AM12/21/21
to rabbitm...@googlegroups.com
Hi,

You can use the feature designed for this - import the definitions from a JSON file:
https://www.rabbitmq.com/definitions.html#import-on-boot

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/fbe77d6b-5c6a-4740-b0b2-d7d78dffaa2en%40googlegroups.com.


--
Michał
RabbitMQ team
Reply all
Reply to author
Forward
0 new messages