Skip to content

Add /docker-entrypoint-initdb.d customization hooks #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ if [ "$1" = 'rabbitmq-server' ]; then
export RABBITMQ_CTL_ERL_ARGS="$RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS"
fi

echo
for f in /docker-entrypoint-initdb.d/*; do
case "$f" in
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not test -e and let users choose the language they want to use?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean -x for testing executable status?

The *.sh case is sourcing the script, not just executing it, so it can actually affect the surrounding environment.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides that, it's pretty easy to call out to an interpreter of your choice from a *.sh script.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, my bad. I didn't see you were sourcing the script, not executing it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@md5 Is the sourcing a problem? I guess that the script could affect the environment is a good thing? More power to extend the base docker?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c0deaddict I think the sourcing can be useful, provided the underlying command uses environment variables directly.

*.sh) echo "$0: running $f"; . "$f" ;;
*) echo "$0: ignoring $f" ;;
esac
echo
done

chown -R rabbitmq /var/lib/rabbitmq
set -- gosu rabbitmq "$@"
fi
Expand Down