赞
踩
[root@VM-4-8-centos ~]# cd /usr/local/docker/
[root@VM-4-8-centos docker]# mkdir rabbitmq
[root@VM-4-8-centos docker]# cd rabbitmq/
[root@VM-4-8-centos rabbitmq]# mkdir data
启动脚本
[root@VM-4-8-centos rabbitmq]# vim startRabbitMq.sh
docker run -d \
-v /usr/local/docker/rabbitmq/data:/var/lib/rabbitmq \
-p 5672:5672 -p 15672:15672 \
--name rabbitmq \
--privileged=true \
--restart=always \
--hostname myRabbit rabbitmq:3.9.13-management
权限不足时:
[root@VM-4-8-centos rabbitmq]# chmod -R 700 startRabbitMq.sh
[root@VM-4-8-centos rabbitmq]# ./startRabbitMq.sh
Unable to find image 'rabbitmq:3.9.13-management' locally
3.9.13: Pulling from library/rabbitmq
4d15b49e6975: Pull complete
2108a12354ce: Pull complete
5c6af9d45693: Pull complete
0f87630b6c7c: Pull complete
9234e199a7d9: Pull complete
efaba59aede6: Pull complete
46802a4f12bc: Pull complete
13b60d6df2ff: Pull complete
ac0786dc13e5: Pull complete
Digest: sha256:f5c8c7fd99e4c88527276df319556fdcb56e4d289614c5fefda5ee8d17c5ea89
Status: Downloaded newer image for rabbitmq:3.9.13-management
ee7636e3d0baa7df4d5490c99616fef006bceedb08c46d7a2fea5650a6f01429
然后还有小操作别忘了重启rabbitmq
输入:docker ps -a查看你所有的容器看看有没有开启
docker start (rabbitmq的id)
过一会重进一次浏览器:你的ip:15672进入rabbitMq
查看结果
用户名:guest
密码:guest
进来之后就代表装好了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。