A docker image for administration of RabbitMQ
(using rabbitmqadmin
and/or rabbitmqctl
)
The container contains the following:
- rabbitmqadmin
- rabbitmqctl
- jq - command line JSON processor
- python - needed to support
rabbitmqadmin
The default CMD
is rmq
which invokes rabbitmqctl
honoring environment variables.
A few environment variables can be provided:
name | default | description |
---|---|---|
RABBIT_HOST |
127.0.0.1 |
IP or FQDN of the RabbitMQ server |
RABBIT_PORT |
15672 |
Management port of the RabbitMQ server |
RABBIT_USER /RABBIT_PASSWORD |
guest |
Administrator username/password (used by rmqa) |
RABBIT_ERLANG_COOKIE |
<unset> |
Erlang cookie (used by rmq) |
The following are some common examples for how you might use the container.
docker run -e RABBIT_HOST=rabbitmqserver \
-e RABBIT_USER=admin -e RABBIT_PASSWORD=p@ssw0rd \
ghcr.io/chris-peterson/rmq-cli:main rmqa list queues
docker run -e RABBIT_HOST=rabbitmqserver \
-e RABBIT_USER=admin -e RABBIT_PASSWORD=p@ssw0rd \
ghcr.io/chris-peterson/rmq-cli:main rmqa export config.json
docker run -e RABBIT_HOST=rabbitmqserver \
-e RABBIT_USER=admin -e RABBIT_PASSWORD=p@ssw0rd \
ghcr.io/chris-peterson/rmq-cli:main rmqa show overview --format=pretty_json
stages:
- snapshot
- deploy
- rollback
image: ghcr.io/chris-peterson/rmq-cli:main
variables:
RABBIT_USER: admin
RABBIT_PASSWORD: p@ssw0rd
.snapshot:
stage: snapshot
script: rmqa export $RABBIT_HOST.config
artifacts:
paths:
- $RABBIT_HOST.config
expire_in: 1 week
.deploy:
stage: deploy
script: scripts/deploy.sh
when: manual
.rollback:
stage: rollback
script: rmqa import $RABBIT_HOST.config
when: manual
snapshot:test:
extends: .snapshot
environment: test
variables:
RABBIT_HOST: test-rabbitmqserver
deploy:test:
extends: .deploy
environment: test
variables:
RABBIT_HOST: test-rabbitmqserver
rollback:test:
extends: .rollback
environment: test
variables:
RABBIT_HOST: test-rabbitmqserver
snapshot:production:
extends: .snapshot
environment: production
variables:
RABBIT_HOST: production-rabbitmqserver
deploy:production:
extends: .deploy
environment: production
variables:
RABBIT_HOST: production-rabbitmqserver
rollback:production:
extends: .rollback
environment: production
variables:
RABBIT_HOST: production-rabbitmqserver