下载官方Dockerfile
git clone https://github.com/apache/rocketmq-docker.git
选择M1适合的版本
cd rocketmq-docker/image-build
执行:编译成docker 镜像脚本
sh build-image.sh 4.8.0 alpine
rocketmq-console 控制台镜像下载
docker search rocketmq-console
docker pull candice0630/rocketmq-console-ng
创建目录及文件
mkdir -p
/Users/zhaopengfei/docker/rocketmq/broker/conf
vim broker.conf
vim ocketmq.yml
broker.conf
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
brokerClusterName = DefaultCluster
brokerName = broker-b
brokerId = 0
deleteWhen = 04
fileReservedTime = 48
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
# Set self-defined brokerIP address (e.g. the host node's)
brokerIP1=192.168.100.102
rocketmq.yml
version: '3'
services:
namesrv:
image: apacherocketmq/rocketmq:4.8.0-alpine
container_name: rmqnamesrv
restart: on-failure
ports:
- 9876:9876
environment:
JAVA_OPT: -server -Xms256m -Xmx256m
command: sh mqnamesrv
broker:
image: apacherocketmq/rocketmq:4.8.0-alpine
container_name: rmqbroker
restart: on-failure
ports:
- 10909:10909
- 10911:10911
- 10912:10912
volumes:
# 本地目录broker.conf 文件映射: 容器目录文件broker.conf
- /Users/zhaopengfei/docker/rocketmq/broker/conf/broker.conf:/home/rocketmq/rocketmq-4.8.0/conf/broker.conf
command: sh mqbroker -n namesrv:9876 -c /home/rocketmq/rocketmq-4.8.0/conf/broker.conf
depends_on:
- namesrv
rocketmq-console:
image: candice0630/rocketmq-console-ng:2.0
container_name: rmqconsole
restart: on-failure
ports:
- 19876:8080
environment:
JAVA_OPTS: -Drocketmq.config.namesrvAddr=namesrv:9876 -Drocketmq.config.isVIPChannel=false
depends_on:
- namesrv
[参考:]
https://juejin.cn/post/7092044150820438052
https://juejin.cn/post/6844904008629354504
https://github.com/apache/rocketmq-docker
网友评论