1、拉取RabbitMQ镜像
注意:dockers拉取的rabbitMq的镜像默认不开启管理后台功能;想要使用管理后台功需要执行docker pull rabbitmq:management命令进行镜像拉取
C:\Users\Administrator>docker pull rabbitmq:management
management: Pulling from library/rabbitmq
7b1a6ab2e44d: Pull complete
37f453d83d8f: Pull complete
e64e769bc4fd: Pull complete
c288a913222f: Pull complete
12addf9c8bf9: Pull complete
eaeb088e057d: Pull complete
b63d48599313: Pull complete
05c99d3d2a57: Pull complete
43665bfbc3f9: Pull complete
f14c7d7911b1: Pull complete
Digest: sha256:4c4b66ad5ec40b2c27943b9804d307bf31c17c8537cd0cd107236200a9cd2814
Status: Downloaded newer image for rabbitmq:management
docker.io/library/rabbitmq:management
C:\Users\Administrator>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
rabbitmq management 6c3c2a225947 2 years ago 253MB
2、创建RabbitMQ容器
创建一个名为rabbitmq的容器,并设置RabbitMQ默认用户名和密码分别为ruoyi、ruoyi123
C:\Users\Administrator>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92785a18ac71 rabbitmq:management "docker-entrypoint.s…" 24 seconds ago Up 22 seconds 0.0.0.0:4369->4369/tcp, 0.0.0.0:5671-5672->5671-5672/tcp, 0.0.0.0:15671-15672->15671-15672/tcp, 0.0.0.0:25672->25672/tcp, 15691-15692/tcp rabbitmq
3、验证是否安装成功
登录RabbitMq后台管理端,默认地址就是ip:15672,能登录成功便是启动成功。
4.若安装时没有开启管理功能
docker exec -it 容器id /bin/bash
rabbitmq-plugins enable rabbitmq_management