Skip to content

chris-peterson/rmq-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

A docker image for administration of RabbitMQ (using rabbitmqadmin and/or rabbitmqctl)

The container contains the following:

The default CMD is rmq which invokes rabbitmqctl honoring environment variables.

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)

Examples

The following are some common examples for how you might use the container.

Example: 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 list queues

Example: Export Configuration

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

Example: Show Overview

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

Example: GitLab CI

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

About

A docker image for administration of RabbitMQ

Topics

Resources

Stars

Watchers

Forks

Languages

  • Shell 51.7%
  • Dockerfile 48.3%