Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.

Commit c4b04ea

Browse files
committed
Mount .erlang.cookie file
Context: we want to move away from environment variables and use either config files or env files (such as the rabbitmq-env.conf). Since .erlang.cookie is neither, the official RabbitMQ Docker image handles this by writing the value from the RABBITMQ_ERLANG_COOKIE env var into the file if it does not exist. The problem is that if this file exists, and the value is different from the RABBITMQ_ERLANG_COOKIE env var, CLI tools will not be able to communicate with the rabbit node, as described here: rabbitmq/rabbitmq-cli#443 The only gotcha is that this file must be owned by the user, and privileges should not be too open (git should have captured this). If not, RabbitMQ will fail to boot. This is somewhat similar to how OpenSSH reacts when private key permissions are too open. re docker-library/rabbitmq#422 (comment) Signed-off-by: Gerhard Lazu <[email protected]>
1 parent 2bf26ba commit c4b04ea

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

docker/docker-compose-dist-tls.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ services:
2626
cap_add:
2727
- ALL
2828
hostname: rmq0-dist-tls
29-
environment:
30-
RABBITMQ_ERLANG_COOKIE: rmq0-dist-tls
29+
# environment:
30+
# RABBITMQ_LOG: debug,+color
3131
volumes:
32+
- ./erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
3233
- ./rabbitmq-dist-tls.conf:/etc/rabbitmq/rabbitmq.conf:ro
3334
- ./rabbitmq-env.conf:/etc/rabbitmq/rabbitmq-env.conf:ro
3435
- ./rabbitmq-ssl_dist.config:/etc/rabbitmq/ssl_dist.config:ro

docker/docker-compose-overview.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ services:
2626
cap_add:
2727
- ALL
2828
hostname: rmq0
29-
environment:
30-
RABBITMQ_ERLANG_COOKIE: rabbitmq-overview
29+
# environment:
30+
# RABBITMQ_LOG: debug,+color
3131
volumes:
32+
- ./erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
3233
- ./rabbitmq-overview.conf:/etc/rabbitmq/rabbitmq.conf:ro
3334
- ./rabbitmq-overview-definitions.json:/etc/rabbitmq/rabbitmq-definitions.json:ro
3435
# we want to simulate hitting thresholds

docker/docker-compose-qq.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ services:
2626
cap_add:
2727
- ALL
2828
hostname: rmq0-qq
29-
environment:
30-
RABBITMQ_ERLANG_COOKIE: rabbitmq-qq
29+
# environment:
30+
# RABBITMQ_LOG: debug,+color
3131
volumes:
32+
- ./erlang.cookie:/var/lib/rabbitmq/.erlang.cookie
3233
- ./rabbitmq-qq.conf:/etc/rabbitmq/rabbitmq.conf:ro
3334
- ./rabbitmq-qq-env.conf:/etc/rabbitmq/rabbitmq-env.conf:ro
3435
- ./rabbitmq-qq-definitions.json:/etc/rabbitmq/rabbitmq-definitions.json:ro

docker/erlang.cookie

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rabbitmq-prometheus

0 commit comments

Comments
 (0)