Skip to content

Commit

Permalink
docker-compose script has been added for 4.1.0-incubating (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrillyun authored and zhouxinyu committed Mar 22, 2018
1 parent ad6b03c commit f215ab8
Show file tree
Hide file tree
Showing 14 changed files with 156 additions and 0 deletions.
51 changes: 51 additions & 0 deletions rocketmq-docker/4.1.0-incubating/broker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#
# 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.
#

# Start from a Java image.
FROM java:8

ARG version

# Rocketmq version
ENV ROCKETMQ_VERSION ${version}

# Rocketmq home
ENV ROCKETMQ_HOME /opt/rocketmq-${ROCKETMQ_VERSION}



WORKDIR ${ROCKETMQ_HOME}

RUN mkdir -p \
/opt/logs \
/opt/store

RUN curl https://dist.apache.org/repos/dist/release/rocketmq/${ROCKETMQ_VERSION}/rocketmq-all-${ROCKETMQ_VERSION}-bin-release.zip -o rocketmq.zip \
&& unzip rocketmq.zip \
&& mv rocketmq-all*/* . \
&& rmdir rocketmq-all* \
&& rm rocketmq.zip


RUN chmod +x bin/mqbroker

CMD cd ${ROCKETMQ_HOME}/bin && export JAVA_OPT=" -Duser.home=/opt" && sh mqbroker -n namesrv:9876


EXPOSE 10909 10911
VOLUME /opt/logs \
/opt/store
1 change: 1 addition & 0 deletions rocketmq-docker/4.1.0-incubating/broker/docker_build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t apache/incubator-rocketmq-broker:4.1.0-incubating .
3 changes: 3 additions & 0 deletions rocketmq-docker/4.1.0-incubating/broker/docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

sudo docker build -t apache/incubator-rocketmq-broker:4.1.0-incubating .
1 change: 1 addition & 0 deletions rocketmq-docker/4.1.0-incubating/broker/docker_run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -d -p 10911:10911 -p 10909:10909 --name rmqbroker apache/incubator-rocketmq-broker:4.1.0-incubating
2 changes: 2 additions & 0 deletions rocketmq-docker/4.1.0-incubating/broker/docker_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo docker run -d -p 10911:10911 -p 10909:10909 --name rmqbroker apache/incubator-rocketmq-broker:4.1.0-incubating
25 changes: 25 additions & 0 deletions rocketmq-docker/4.1.0-incubating/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '2'
services:
namesrv:
build:
context: ./namesrv
args:
- version=4.1.0-incubating
ports:
- 9876:9876
volumes:
- ./namesrv/logs:/opt/logs
- ./namesrv/store:/opt/store
broker:
build:
context: ./broker
args:
- version=4.1.0-incubating
ports:
- 10909:10909
- 10911:10911
volumes:
- ./broker/logs:/opt/logs
- ./broker/store:/opt/store
depends_on:
- namesrv
49 changes: 49 additions & 0 deletions rocketmq-docker/4.1.0-incubating/namesrv/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# 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.
#

# Start from a Java image.
FROM java:8

ARG version

# Rocketmq version
ENV ROCKETMQ_VERSION ${version}

# Rocketmq home
ENV ROCKETMQ_HOME /opt/rocketmq-${ROCKETMQ_VERSION}

WORKDIR ${ROCKETMQ_HOME}

RUN mkdir -p \
/opt/logs \
/opt/store

RUN curl https://dist.apache.org/repos/dist/release/rocketmq/${ROCKETMQ_VERSION}/rocketmq-all-${ROCKETMQ_VERSION}-bin-release.zip -o rocketmq.zip \
&& unzip rocketmq.zip \
&& mv rocketmq-all*/* . \
&& rmdir rocketmq-all* \
&& rm rocketmq.zip


RUN chmod +x bin/mqnamesrv

CMD cd ${ROCKETMQ_HOME}/bin && export JAVA_OPT=" -Duser.home=/opt" && sh mqnamesrv


EXPOSE 9876
VOLUME /opt/logs \
/opt/store
1 change: 1 addition & 0 deletions rocketmq-docker/4.1.0-incubating/namesrv/docker_build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t apache/incubator-rocketmq-namesrv:4.1.0-incubating .
3 changes: 3 additions & 0 deletions rocketmq-docker/4.1.0-incubating/namesrv/docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

sudo docker build -t apache/incubator-rocketmq-namesrv:4.1.0-incubating .
1 change: 1 addition & 0 deletions rocketmq-docker/4.1.0-incubating/namesrv/docker_run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -d -p 9876:9876 --name rmqnamesrv apache/incubator-rocketmq-namesrv:4.1.0-incubating
2 changes: 2 additions & 0 deletions rocketmq-docker/4.1.0-incubating/namesrv/docker_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
sudo docker run -d -p 9876:9876 --name rmqnamesrv apache/incubator-rocketmq-namesrv:4.1.0-incubating
7 changes: 7 additions & 0 deletions rocketmq-docker/4.1.0-incubating/play.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
docker build -t apache/incubator-rocketmq-namesrv:4.1.0-incubating ./namesrv

docker build -t apache/incubator-rocketmq-broker:4.1.0-incubating ./broker

docker run -d -p 9876:9876 --name rmqnamesrv apache/incubator-rocketmq-namesrv:4.1.0-incubating

docker run -d -p 10911:10911 -p 10909:10909 --name rmqbroker --link rmqnamesrv:rmqnamesrv -e "NAMESRV_ADDR=rmqnamesrv:9876" apache/incubator-rocketmq-broker:4.1.0-incubating
8 changes: 8 additions & 0 deletions rocketmq-docker/4.1.0-incubating/play.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
!/bin/bash
sudo docker build -t apache/incubator-rocketmq-namesrv:4.1.0-incubating ./namesrv

sudo docker build -t apache/incubator-rocketmq-broker:4.1.0-incubating ./broker

sudo docker run -d -p 9876:9876 --name rmqnamesrv apache/incubator-rocketmq-namesrv:4.1.0-incubating

sudo docker run -d -p 10911:10911 -p 10909:10909 --name rmqbroker --link rmqnamesrv:rmqnamesrv -e "NAMESRV_ADDR=rmqnamesrv:9876" apache/incubator-rocketmq-broker:4.1.0-incubating
2 changes: 2 additions & 0 deletions rocketmq-docker/4.1.0-incubating/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up -d

0 comments on commit f215ab8

Please sign in to comment.