Skip to content

A Dockerfile that produces a Docker Image for RabbitMQ

License

Notifications You must be signed in to change notification settings

AnirKulk/docker-rabbitmq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RabbitMQ Dockerfile

A Dockerfile that produces a Docker Image for RabbitMQ.

RabbitMQ version

The master branch currently hosts RabbitMQ 3.6.15.

Different versions of RabbitMQ are located at the github repo branches.

Usage

Build the image

To create the image joyahan/rabbitmq, execute the following command on the docker-rabbitmq folder:

$ docker build -t joyahan/rabbitmq .

Run the image

To run the image and bind to host port 5672:

$ docker run -d --name rabbitmq -p 5672:5672 joyahan/rabbitmq

If you want also to expose the RabbitMQ Management interface, you will need also to expose port 15672:

$ docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 joyahan/rabbitmq

The first time you run your container, a new user rabbitmq with all privileges will be created with a random password. To get the password, check the logs of the container by running:

docker logs <CONTAINER_ID>

You will see an output like the following:

========================================================================
RabbitMQ User: "rabbitmq"
RabbitMQ Password: "8psfzXmp6t23rKr6"
RabbitMQ Virtual Host: "/"
========================================================================

Credentials

If you want to preset credentials instead of a random generated ones, you can set the following environment variables:

  • RABBITMQ_USERNAME to set a specific username
  • RABBITMQ_PASSWORD to set a specific password
  • RABBITMQ_VHOST to set a specific Virtual Host

On this example we will preset our custom username and password:

$ docker run -d \
    --name rabbitmq \
    -p 5672:5672 \
    -e RABBITMQ_USERNAME=myusername \
    -e RABBITMQ_PASSWORD=mypassword \
    -e RABBITMQ_VHOST=myvhost \
    joyahan/rabbitmq

Copyright

Copyright (c) 2014 Ferran Rodenas. See LICENSE for details.

About

A Dockerfile that produces a Docker Image for RabbitMQ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%