Skip to content

Commit

Permalink
feat: build docker image for broker
Browse files Browse the repository at this point in the history
Signed-off-by: Li Zhanhui <[email protected]>
  • Loading branch information
lizhanhui committed Oct 19, 2023
1 parent c96ccf0 commit a11b4af
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion distribution/bin/start-broker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
DIST_DIR="$(dirname "SCRIPT_DIR")"
DIST_DIR="$(dirname "$SCRIPT_DIR")"
"$SCRIPT_DIR"/run-server.sh com.automq.rocketmq.broker.BrokerStartup -c "$DIST_DIR/conf/broker.yaml"
4 changes: 4 additions & 0 deletions distribution/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM amazoncorretto:21
WORKDIR /root
ADD rocketmq-on-s3.tar.gz .
CMD ["/root/rocketmq-on-s3/bin/start-broker.sh"]
27 changes: 27 additions & 0 deletions distribution/docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/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.
#

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
REPO_DIR=$(dirname "$(dirname "$SCRIPT_DIR")")
cd "$REPO_DIR" || exit 1
mvn package -Dmaven.test.skip=true
cp distribution/target/rocketmq-on-s3.tar.gz "$SCRIPT_DIR"
cd "$SCRIPT_DIR" || exit 1
docker build -t rocketmq-on-s3:"$(uname -m)"-0.0.1 -f Dockerfile .


2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
</executions>
</plugin>
</plugins>
<finalName>rocketmq-on-s3-${project.version}</finalName>
<finalName>rocketmq-on-s3</finalName>
</build>
</project>

0 comments on commit a11b4af

Please sign in to comment.