diff --git a/rocketmq-docker/Dockerfile b/rocketmq-docker/Dockerfile new file mode 100644 index 0000000..d400357 --- /dev/null +++ b/rocketmq-docker/Dockerfile @@ -0,0 +1,65 @@ +# +# 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. +# + +FROM openjdk:17-jdk-alpine + +MAINTAINER automq + +USER root + + # Install dependency +# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories +RUN apk add --no-cache bash gettext nmap-ncat openssl busybox-extras libc6-compat libgcc libstdc++ + + +ARG version + +# Rocketmq version +ENV ROCKETMQ_VERSION ${version} + + +ARG ROCKETMQ_DIR + +ENV ROCKETMQ_NAME rocketmq-on-s3 +ENV ROCKETMQ_HOME /home/rocketmq/${ROCKETMQ_NAME}-${ROCKETMQ_VERSION} + +WORKDIR ${ROCKETMQ_HOME} + + +# Install +COPY rocketmq/ ${ROCKETMQ_HOME}/dist + +RUN mv ${ROCKETMQ_HOME}/dist/* ${ROCKETMQ_HOME}/ && \ + rm -rf ${ROCKETMQ_HOME}/dist + + + +# RUN chown -R ${uid}:${gid} ${ROCKETMQ_HOME} +EXPOSE 8081 + +RUN chmod a+x ${ROCKETMQ_HOME}/bin/run-server.sh + + +# Export Java options +RUN export JAVA_OPT=" -Duser.home=/opt" + + +WORKDIR ${ROCKETMQ_HOME}/bin + +CMD ["sh", "-c", "sh ./bin/run-server.sh com.automq.rocketmq.broker.BrokerStartup -c ./conf/broker.yaml"] + + diff --git a/rocketmq-docker/build-image.sh b/rocketmq-docker/build-image.sh new file mode 100644 index 0000000..a5422b2 --- /dev/null +++ b/rocketmq-docker/build-image.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# 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. + + +ROCKETMQ_VERSION=$1 + +cp -r ../../rocketmq ./ + + +docker build --no-cache -f Dockerfile -t apache/rocketmq:${ROCKETMQ_VERSION}-alpine --build-arg version=${ROCKETMQ_VERSION} . --progress=plain \ No newline at end of file