我这边用的是阿里云服务器安装的。
1. 查询镜像
docker search rabbitmq:management
可以看到如下结果
[root@iZuf6iw2bqogm9ifl00639Z ~]# docker search rabbitmq:management
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
macintoshplus/rabbitmq-management Based on rabbitmq:management whit python and… 6 [OK]
xiaochunping/rabbitmq xiaochunping/rabbitmq:management 2018-06-30 3
transmitsms/rabbitmq-sharded Fork of rabbitmq:management with sharded_exc… 0
2. 拉取镜像
docker pull rabbitmq:management
[root@iZuf6iw2bqogm9ifl00639Z ~]# docker pull rabbitmq:management
management: Pulling from library/rabbitmq
2746a4a261c9: Pull complete
4c1d20cdee96: Pull complete
0d3160e1d0de: Pull complete
c8e37668deea: Pull complete
f6d70ae6375d: Pull complete
42fdb8fdc1ff: Downloading [===============================> ] 19.57MB/31.21MB
8f28c83ff85a: Download complete
11ed3b0378c8: Download complete
b6f5d8529d49: Download complete
72c578dee4d9: Download complete
2ea3b83659c0: Download complete
887ca182cfa0: Download complete
等待镜像安装完成,如果下载慢的可以更换docker镜像。怎么操作自行百度哦。
3. 启动RabbitMQ
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
[root@iZuf6iw2bqogm9ifl00639Z ~]# docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
5cb7535176ef02f09b2373d275a7f3c5a4b0c0de0d36239ada5215544c7f37ec
[root@iZuf6iw2bqogm9ifl00639Z ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5cb7535176ef rabbitmq:management "docker-entrypoint.s…" 19 seconds ago Up 19 seconds 4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp rabbitmq
到这里就安装完成啦。在浏览器输入 ip:15672 就可以打开RabbitMQ的管理界面啦,如果打不开看看你有没有开放端口哦。阿里云服务器在安全组里面设置。