This is an automated email from the ASF dual-hosted git repository.

elek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new 87557f7  RATIS-465. Add docker support for running filestore example. 
Contributed by Mukul Kumar Singh.
87557f7 is described below

commit 87557f7496581524dae43ea6c6a062d479b387c4
Author: Márton Elek <[email protected]>
AuthorDate: Sun Jun 30 06:01:16 2019 +0200

    RATIS-465. Add docker support for running filestore example. Contributed by 
Mukul Kumar Singh.
---
 ratis-examples/src/main/docker/Dockerfile          | 39 ++++++++++++++
 ratis-examples/src/main/docker/docker-compose.yaml | 63 ++++++++++++++++++++++
 2 files changed, 102 insertions(+)

diff --git a/ratis-examples/src/main/docker/Dockerfile 
b/ratis-examples/src/main/docker/Dockerfile
new file mode 100644
index 0000000..52d517e
--- /dev/null
+++ b/ratis-examples/src/main/docker/Dockerfile
@@ -0,0 +1,39 @@
+# 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:8-jdk
+RUN apt-get update && apt-get install -y jq curl python python-pip sudo netcat 
&& apt-get clean
+RUN pip install robotframework
+RUN wget -O /usr/local/bin/dumb-init 
https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64
+RUN chmod +x /usr/local/bin/dumb-init
+RUN mkdir -p /etc/security/keytabs && chmod -R a+wr /etc/security/keytabs
+ADD 
https://repo.maven.apache.org/maven2/org/jboss/byteman/byteman/4.0.4/byteman-4.0.4.jar
 /opt/byteman.jar
+RUN chmod o+r /opt/byteman.jar
+ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
+ENV PATH $PATH:/opt/ratis/bin
+
+RUN apt-get install -y jsvc
+ENV JSVC_HOME=/usr/bin
+
+RUN addgroup --gid 1000 ratis
+RUN adduser --disabled-password --gecos "" --uid 1000 ratis --gid 100 --home 
/opt/ratis
+RUN echo "ratis ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
+RUN chown ratis /opt
+
+WORKDIR /opt/ratis
+
+VOLUME /data
+USER ratis
diff --git a/ratis-examples/src/main/docker/docker-compose.yaml 
b/ratis-examples/src/main/docker/docker-compose.yaml
new file mode 100644
index 0000000..1a51b5a
--- /dev/null
+++ b/ratis-examples/src/main/docker/docker-compose.yaml
@@ -0,0 +1,63 @@
+# 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.
+
+version: "3"
+services:
+   server1:
+      image: apache/ratis-runner
+      container_name: n0
+      hostname: n0
+      volumes:
+        - ../../../:/opt/ratis
+      ports:
+        - 9864
+      command: ["/opt/ratis/src/main/bin/server.sh", "filestore", "server",
+                "--id", "n0", "--storage", "/tmp/data",
+                "--peers", "n0:n0:9864,n1:n1:9864,n2:n2:9864"]
+
+   server2:
+      image: apache/ratis-runner
+      container_name: n1
+      hostname: n1
+      volumes:
+      - ../../../:/opt/ratis
+      ports:
+      - 9864
+      command: ["/opt/ratis/src/main/bin/server.sh", "filestore", "server",
+                "--id", "n1", "--storage", "/tmp/data",
+                "--peers", "n0:n0:9864,n1:n1:9864,n2:n2:9864"]
+
+   server3:
+      image: apache/ratis-runner
+      container_name: n2
+      hostname: n2
+      volumes:
+      - ../../../:/opt/ratis
+      ports:
+      - 9864
+      command: ["/opt/ratis/src/main/bin/server.sh", "filestore", "server",
+                "--id", "n2", "--storage", "/tmp/data",
+                "--peers", "n0:n0:9864,n1:n1:9864,n2:n2:9864"]
+
+   client:
+      image: apache/ratis-runner
+      container_name: client
+      hostname: client
+      volumes:
+      - ../../../:/opt/ratis
+      ports:
+      - 9864
+      command: ["sleep", "infinity"]
\ No newline at end of file

Reply via email to