拉取鏡像docker
docker pull rabbitmq:3-management
啓動鏡像(默認用戶名密碼),默認guest 用戶,密碼也是 guestpost
docker run -d --hostname my-rabbit --name rabbit -p 15672:15672 -p 5672:5672 rabbitmq:3-management
啓動鏡像(設置用戶名密碼)code
docker run -d --hostname my-rabbit --name rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password -p 15672:15672 -p 5672:5672 rabbitmq:3-management
完成後訪問:http://localhost:15672/blog
參考:https://docs.docker.com/samples/library/rabbitmq/#running-the-daemonrabbitmq