Skip to content

Commit

Permalink
Merge pull request #3 from AutoMQ/ros_dockerfile
Browse files Browse the repository at this point in the history
feat: add Dockerfile and shell for image build
  • Loading branch information
wangxye authored Oct 18, 2023
2 parents db715cb + 51c7dac commit 3d995e3
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
65 changes: 65 additions & 0 deletions rocketmq-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]


24 changes: 24 additions & 0 deletions rocketmq-docker/build-image.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3d995e3

Please sign in to comment.