docker安装rabbitmq
拉取镜像
docker pull rabbitmq:3-management
启动镜像(默认用户名密码),默认guest 用户,密码也是 guest
docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
启动镜像(设置用户名密码)
docker run -d --hostname my-rabbit --name rabbit -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 --restart=always rabbitmq:3-management
安装延时插件:https://www.rabbitmq.com/community-plugins.html
插件拷贝至容器内,启动插件后重启容器
docker cp /opt/rabbitmq_delayed_message_exchange-3.9.0.ez rabbit:/plugins/ rabbitmq-plugins enable rabbitmq_delayed_message_exchange docker restart rabbit