-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed RabbitMQ directory ownership issues
- Loading branch information
Showing
4 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,8 @@ FROM rabbitmq:3.5.3-management | |
MAINTAINER Dimitris Kapanidis [email protected] | ||
|
||
COPY rabbitmq-cluster /usr/local/bin/ | ||
COPY pre-entrypoint.sh / | ||
|
||
EXPOSE 5672 15672 25672 4369 9100 9101 9102 9103 9104 9105 | ||
USER rabbitmq | ||
ENTRYPOINT ["/pre-entrypoint.sh"] | ||
CMD ["rabbitmq-cluster"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
build: | ||
images: | ||
Dockerfile: harbur/rabbitmq-cluster | ||
rabbitmq-cluster: | ||
build: Dockerfile | ||
image: harbur/rabbitmq-cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
mkdir -p /var/lib/rabbitmq | ||
|
||
if [ "$ERLANG_COOKIE" ]; then | ||
cookieFile='/var/lib/rabbitmq/.erlang.cookie' | ||
if [ -e "$cookieFile" ]; then | ||
if [ "$(cat "$cookieFile" 2>/dev/null)" != "$ERLANG_COOKIE" ]; then | ||
echo >&2 | ||
echo >&2 "warning: $cookieFile contents do not match ERLANG_COOKIE" | ||
echo >&2 | ||
fi | ||
else | ||
echo "$ERLANG_COOKIE" > "$cookieFile" | ||
chmod 600 "$cookieFile" | ||
chown rabbitmq "$cookieFile" | ||
fi | ||
fi | ||
|
||
chown rabbitmq:rabbitmq /var/lib/rabbitmq | ||
exec gosu rabbitmq ./docker-entrypoint.sh "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters