1:Dokcer搜索RocketMq
docker search rocketmq
2:查看某一个镜像里面的所有版本(如foxiswho/rocketmq)
3:拷贝RocketMQ到宿主机
### 1.创建目录
mkdir -p /mydata/rocketmq/conf/
### 2.将容器内配置文件复制到主机
docker cp 容器ID:etc/rocketmq/broker.conf /mydata/rocketmq/conf/
### 3.修改rocketMQ配置文件broker.conf
vim broker.conf
添加brokerIP1=主机IP
4:启动NameServer
docker run -d -p 9876:9876 --name rmqserver foxiswho/rocketmq:server-4.5.1
5.启动Broker
docker run -d -p 10911:10911 -p 10909:10909\
--name rmqbroker --link rmqserver:namesrv\
-e "NAMESRV_ADDR=namesrv:9876" -e "JAVA_OPTS=-Duser.home=/opt"\
-e "JAVA_OPT_EXT=-server -Xms128m -Xmx128m"\
-v /mydata/rocketmq/conf/broker.conf:/etc/rocketmq/broker.conf \
foxiswho/rocketmq:broker-4.5.1
6.安装Console
docker run -d --name rmqconsole -p 8180:8080 --link rmqserver:namesrv\
-e "JAVA_OPTS=-Drocketmq.namesrv.addr=namesrv:9876\
-Dcom.rocketmq.sendMessageWithVIPChannel=false"\
-t styletang/rocketmq-console-ng
7:查看是否安装成功
docker ps