1.安装docker环境

docker进阶.pdf

2.docker安装rabbitmq

1.拉取并执行镜像创建容器

  1. docker run -di --hostname my-rabbit --name myrabbit -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=123456 -p 15672:15672 -p 5672:5672 -p 25672:25672 -p 61613:61613 -p 1883:1883 rabbitmq:management

2.检查是否正常开启

  1. [root@lhm ~]# docker ps
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. b0b4fbb3aa19 rabbitmq:management "docker-entrypoint.s…" 3 seconds ago Up 2 seconds 4369/tcp, 0.0.0.0:1883->1883/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 0.0.0.0:15672->15672/tcp, 0.0.0.0:25672->25672/tcp, 0.0.0.0:61613->61613/tcp, 15691-15692/tcp myrabbit my_wordpress_db_1