GithubHelp home page GithubHelp logo

rabbitmq-docker's Introduction

rabbitmq-docker

Dockerfile source for RabbitMQ docker image.

Upstream

This source repo was originally copied from: https://github.com/docker-library/rabbitmq

For Upstream documentation visit: https://github.com/docker-library/docs/tree/master/rabbitmq

Disclaimer

This is not an official Google product.

About

This image contains an installation of RabbitMQ 3.x.

For more information, see the Official Image Marketplace Page.

Pull command:

gcloud docker -- pull marketplace.gcr.io/google/rabbitmq3

Dockerfile for this image can be found here.

Table of Contents

Using Kubernetes

Running RabbitMQ

Starting a RabbitMQ instance

Replace your-erlang-cookie with a valid cookie value. For more information, see RABBITMQ_ERLANG_COOKIE in Environment Variable.

Copy the following content to pod.yaml file, and run kubectl create -f pod.yaml.

apiVersion: v1
kind: Pod
metadata:
  name: some-rabbitmq
  labels:
    name: some-rabbitmq
spec:
  containers:
    - image: marketplace.gcr.io/google/rabbitmq3
      name: rabbitmq
      env:
        - name: "RABBITMQ_ERLANG_COOKIE"
          value: "unique-erlang-cookie"

Run the following to expose the ports:

kubectl expose pod some-rabbitmq --name some-rabbitmq-4369 \
  --type LoadBalancer --port 4369 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-5671 \
  --type LoadBalancer --port 5671 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-5672 \
  --type LoadBalancer --port 5672 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-25672 \
  --type LoadBalancer --port 25672 --protocol TCP

For information about how to retain your RabbitMQ data across container restarts, see Adding persistence.

Connecting to a running RabbitMQ container

Open an interactive shell to the RabbitMQ container. Note that because we open a shell directly in the container, Erlang cookie does not have to be explicitly specified.

kubectl exec -it some-rabbitmq -- /bin/bash

rabbitmqctl can be run in the shell. For example, we can do a node health check.

rabbitmqctl node_health_check

Adding persistence

Running with persistent data volumes

We can store data on persistent volumes, this way the installation remains intact across restarts.

Copy the following content to pod.yaml file, and run kubectl create -f pod.yaml.

apiVersion: v1
kind: Pod
metadata:
  name: some-rabbitmq
  labels:
    name: some-rabbitmq
spec:
  containers:
    - image: marketplace.gcr.io/google/rabbitmq3
      name: rabbitmq
      env:
        - name: "RABBITMQ_ERLANG_COOKIE"
          value: "unique-erlang-cookie"
      volumeMounts:
        - name: rabbitmq-data
          mountPath: /var/lib/rabbitmq
  volumes:
    - name: rabbitmq-data
      persistentVolumeClaim:
        claimName: rabbitmq-data
---
# Request a persistent volume from the cluster using a Persistent Volume Claim.
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: rabbitmq-data
  annotations:
    volume.alpha.kubernetes.io/storage-class: default
spec:
  accessModes: [ReadWriteOnce]
  resources:
    requests:
      storage: 5Gi

Run the following to expose the ports:

kubectl expose pod some-rabbitmq --name some-rabbitmq-4369 \
  --type LoadBalancer --port 4369 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-5671 \
  --type LoadBalancer --port 5671 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-5672 \
  --type LoadBalancer --port 5672 --protocol TCP
kubectl expose pod some-rabbitmq --name some-rabbitmq-25672 \
  --type LoadBalancer --port 25672 --protocol TCP

Using Docker

Running RabbitMQ

Starting a RabbitMQ instance

Replace your-erlang-cookie with a valid cookie value. For more information, see RABBITMQ_ERLANG_COOKIE in Environment Variable.

Use the following content for the docker-compose.yml file, then run docker-compose up.

version: '2'
services:
  rabbitmq:
    container_name: some-rabbitmq
    image: marketplace.gcr.io/google/rabbitmq3
    environment:
      "RABBITMQ_ERLANG_COOKIE": "unique-erlang-cookie"
    ports:
      - '4369:4369'
      - '5671:5671'
      - '5672:5672'
      - '25672:25672'

Or you can use docker run directly:

docker run \
  --name some-rabbitmq \
  -e "RABBITMQ_ERLANG_COOKIE=unique-erlang-cookie" \
  -p 4369:4369 \
  -p 5671:5671 \
  -p 5672:5672 \
  -p 25672:25672 \
  -d \
  marketplace.gcr.io/google/rabbitmq3

For information about how to retain your RabbitMQ data across container restarts, see Adding persistence.

Connecting to a running RabbitMQ container

Open an interactive shell to the RabbitMQ container. Note that because we open a shell directly in the container, Erlang cookie does not have to be explicitly specified.

docker exec -it some-rabbitmq /bin/bash

rabbitmqctl can be run in the shell. For example, we can do a node health check.

rabbitmqctl node_health_check

Adding persistence

Running with persistent data volumes

We can store data on persistent volumes, this way the installation remains intact across restarts. Assume that /path/to/your/rabbitmq is the persistent directory on the host.

Use the following content for the docker-compose.yml file, then run docker-compose up.

version: '2'
services:
  rabbitmq:
    container_name: some-rabbitmq
    image: marketplace.gcr.io/google/rabbitmq3
    environment:
      "RABBITMQ_ERLANG_COOKIE": "unique-erlang-cookie"
    ports:
      - '4369:4369'
      - '5671:5671'
      - '5672:5672'
      - '25672:25672'
    volumes:
      - /path/to/your/rabbitmq:/var/lib/rabbitmq

Or you can use docker run directly:

docker run \
  --name some-rabbitmq \
  -e "RABBITMQ_ERLANG_COOKIE=unique-erlang-cookie" \
  -p 4369:4369 \
  -p 5671:5671 \
  -p 5672:5672 \
  -p 25672:25672 \
  -v /path/to/your/rabbitmq:/var/lib/rabbitmq \
  -d \
  marketplace.gcr.io/google/rabbitmq3

References

Ports

These are the ports exposed by the container image.

Port Description
TCP 4369 epmd port, a peer discovery service used by RabbitMQ nodes and CLI tools.
TCP 5671 Used by AMQP 0-9-1 and 1.0 clients with TLS.
TCP 5672 Used by AMQP 0-9-1 and 1.0 clients without TLS.
TCP 25672 Used by Erlang distribution for inter-node and CLI tools communication. This port is allocated from a dynamic range. By default, it takes the value of AMQP port plus 20000 (5672 + 20000), or 25672.

Environment Variables

These are the environment variables understood by the container image.

Variable Description
RABBITMQ_ERLANG_COOKIE Sets the shared secret Erlang cookie used for authenticating other nodes and clients. For two nodes, or a node and a client, to communicate with each other, they must have the same Erlang cookie.
RABBITMQ_DEFAULT_USER Sets the default user name. Used in conjunction with RABBITMQ_DEFAULT_PASS.

Defaults to guest.
RABBITMQ_DEFAULT_PASS Sets the default user password. Used in conjunction with RABBITMQ_DEFAULT_USER.

Defaults to guest.

Volumes

These are the filesystem paths used by the container image.

Path Description
/var/lib/rabbitmq All RabbitMQ files are installed here.

rabbitmq-docker's People

Contributors

armandomiani avatar axtnsx avatar eugenekorolevich avatar farajn9 avatar harnas-google avatar huyhg avatar jprzychodzen avatar khajduczenia avatar marzinkievitz avatar matt-jns avatar metaver5o avatar ovk6 avatar tomasz-safuryn avatar wgrzelak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rabbitmq-docker's Issues

tune mnesia parameter

Hi

is it possible to tune Mnesia write parameter?
i'm trying to set dump_log_write_threshold for mnesia to be higher then the default value of 100 records and seems like i cannot find the right parameter on the sysctl config format.

is there any way to update this parameter using this image?

thanks
Chen

rabbitmq latest 3.7 broken?

Hi

seems like the latest 3.7 image is still broken.

the prometheus plugin added to the image but i think there is a missing plugin which is
prometheus_process_collector-1.4.3.ez, hence the rabbit log fill with errors of the exporter plugin.

can it be please fixed?

thanks
Chen

Latest update broke the image

Since a few days ago the image fails to boot properly, I get the following errors on k8s

/usr/local/bin/docker-entrypoint.sh: line 391: rabbitmq-plugins: command not found /usr/local/bin/docker-entrypoint.sh: line 437: exec: rabbitmq-server: not found

Enabled plugins are: '[rabbitmq_management,rabbitmq_management_agent,rabbitmq_web_dispatch].'

Output from kubectl version

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.10-gke.36", GitCommit:"34a615f32e9a0c9e97cdb9f749adb392758349a6", GitTreeState:"clean", BuildDate:"2020-04-06T16:33:17Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}

new images looks broken

two issues on the latest images.

  • folder update dot 3.7.13 althouth the actual version of rabbitmq is still 3.7.9, pretty confusing...
  • /plugins points to non-exiting folder which is /usr/lib/rabbitmq/lib/rabbitmq_server-3.7.13/plugins
    as the actual folder that exist is /usr/lib/rabbitmq/lib/rabbitmq_server-3.7.9/plugins

we are looking on latest images exits on gcr marketplace.

  • gcr.io/cloud-marketplace/google/rabbitmq3
  • gcr.io/cloud-marketplace/google/rabbitmq

are we missing something?
10x
chen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.