Skip to content
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

Allow users to use RABBITMQ_ERLANG_COOKIE_FILE to specify the path to an Erlang cookie file (especially for Docker secrets) #280

Closed

Conversation

tianon
Copy link
Member

@tianon tianon commented Sep 21, 2018

Closes #279

… an Erlang cookie file (especially for Docker secrets)
@yosifkit
Copy link
Member

This seems like duplicate work. We put this value in the default rabbitmq cookie file:

if [ "${RABBITMQ_ERLANG_COOKIE:-}" ]; then
cookieFile='/var/lib/rabbitmq/.erlang.cookie'
if [ -e "$cookieFile" ]; then
if [ "$(cat "$cookieFile" 2>/dev/null)" != "$RABBITMQ_ERLANG_COOKIE" ]; then
echo >&2
echo >&2 "warning: $cookieFile contents do not match RABBITMQ_ERLANG_COOKIE"
echo >&2
fi
else
echo "$RABBITMQ_ERLANG_COOKIE" > "$cookieFile"
fi
chmod 600 "$cookieFile"
fi

I think we just need to document where to mount the cookie file like the Dockerfile alludes to:

# set home so that any `--user` knows where to put the erlang cookie
ENV HOME /var/lib/rabbitmq

@tianon
Copy link
Member Author

tianon commented Sep 21, 2018

Ah, good point -- I forget that Docker secrets can be arbitrary mounted anywhere. I'll make a docs PR instead. 👍

Edit: docker-library/docs#1312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants