本文主要是介绍Docker创建Rocketmq-4.8.0镜像,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
rocketmq包含namesrv和broker两部分,这里不使用docker-compose编排,而是将这两部分分别创建容器.
一. namesrv
1. Dockerfile编写
FROM java:8ENV ROCKETMQ_VERSION 4.8.0ENV NAMESRV_HOME /home/rocketmq/namesrv-${ROCKETMQ_VERSION}ENV JAVA_OPT "-Duser.home=/home/rocketmq"WORKDIR ${NAMESRV_HOME}RUN mkdir -p /home/rocketmq/logs /home/rocketmq/storeRUN curl https://dist.apache.org/repos/dist/release/rocketmq/${ROCKETMQ_VERSION}/rocketmq-all-${ROCKETMQ_VERSION}-bin-release.zip -o rocketmq.zip \&& unzip rocketmq.zip \&& rm rocketmq.zip \&& mv rocketmq-all-${ROCKETMQ_VERSION}-bin-release/* ./ \&& rm -rf rocketmq-all-${ROCKETMQ_VERSION}-bin-release \&& cd ${NAMESRV_HOME}/bin \&& sed -i '70s/^/#/' runserver.sh \&& sed -i '74,77s/^/#/' runserver.sh \&& sed -i 's#-Xms[0-9]\+[gm]#-Xms512m#' runserver.sh \&& sed -i 's#-Xmx[0-9]\+[gm]#-Xmx512m#' runserver.sh \&& sed -i 's#-Xmn[0-9]\+[gm]#-Xmn128m#' runserver.sh \&& sed -i 's#-XX:MetaspaceSize=[0-9]\+[gm]#-XX:MetaspaceSize=128m#' runserver.sh \&& sed -i 's#-XX:MaxMetaspaceSize=[0-9]\+[gm]#-XX:MaxMetaspaceSi
这篇关于Docker创建Rocketmq-4.8.0镜像的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!