RabbitMQ docker image is available on Docker Hub. If you have docker installed on your machine, you can easily run RabbitMQ docker container using the following command:
docker run -d -p 15672:15672 -p 5672:5672 -p 5671:5671 --hostname my-rabbitmq --name my-rabbitmq-container rabbitmq:3-management
where:
–hostname is a custom RabbitMQ host name you want to use on your computer. You can use this hostname when referring to this RabbitMQ container running on your local computer.
–name – is a meaningful name for the container. This name will be displayed when using docker ps command. It is helpful to see meaningful names when we list our containers later on.
-p 15672:15672 – is a port mapping where <local computer port>:<docker container port>
What If You Have Docker Image on Docker Hub?
If you have RabbitMQ Docker image in your private Docker Hub account then you can run it the following way:
docker run -d --name rabbit-name-management -p 15672:15672 -p 5672:5672 -p 5671:5671 skargopolov/rabbitmq:3-management
Where
–name – is a meaningful name for the container.
skargopolov/rabbitmq:3-management– is a <Docker Hub username>/<Docker Hub Repository name>:<tag>
-p 15672:15672 – is port mapping where <local computer port>:<docker container port>
To learn more about Docker, check the below list of online video courses that teach Docker.