You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2015/09/25 00:44:44 UTC

[07/21] incubator-geode git commit: [GEODE-177] - Moving Dockerfile into Geode codebase

[GEODE-177] - Moving Dockerfile into Geode codebase


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/e0d7f46a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/e0d7f46a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/e0d7f46a

Branch: refs/heads/feature/GEODE-189
Commit: e0d7f46a692ab5b542051d46aa767e3612746c30
Parents: 7d2296b
Author: William Markito <wm...@pivotal.io>
Authored: Thu Aug 6 14:51:25 2015 -0700
Committer: Kirk Lund <kl...@pivotal.io>
Committed: Thu Aug 13 11:39:43 2015 -0700

----------------------------------------------------------------------
 docker/Dockerfile | 56 +++++++++++++++++++++++++++++++++++++++++
 docker/README.md  | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0d7f46a/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000..ecdd712
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,56 @@
+FROM centos:latest
+MAINTAINER William Markito <wi...@gmail.com>
+
+LABEL Vendor="Apache Geode (incubating)"
+LABEL version=unstable
+
+# download JDK 8
+ENV	JAVA_HOME /jdk1.8.0_51
+
+RUN	yum install -y wget which tar git \
+	&& wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u51-b16/jdk-8u51-linux-x64.tar.gz" \
+	&& tar xf jdk-8u51-linux-x64.tar.gz \
+	&& git clone -b develop https://github.com/apache/incubator-geode.git \
+	&& cd incubator-geode \
+	&& ./gradlew build -Dskip.tests=true \
+	&& ls /incubator-geode | grep -v gemfire-assembly | xargs rm -rf \
+	&& rm -rf /root/.gradle/ \
+	&& rm -rf /incubator-geode/gemfire-assembly/build/distributions/ \
+	&& rm -rf /jdk-8u51-linux-x64.tar.gz \
+	&& rm -rf $JAVA_HOME/*src.zip \
+						$JAVA_HOME/lib/missioncontrol \
+						$JAVA_HOME/lib/visualvm \
+						$JAVA_HOME/lib/*javafx* \
+						$JAVA_HOME/jre/lib/plugin.jar \
+						$JAVA_HOME/jre/lib/ext/jfxrt.jar \
+						$JAVA_HOME/jre/bin/javaws \
+						$JAVA_HOME/jre/lib/javaws.jar \
+						$JAVA_HOME/jre/lib/desktop \
+						$JAVA_HOME/jre/plugin \
+						$JAVA_HOME/jre/lib/deploy* \
+						$JAVA_HOME/jre/lib/*javafx* \
+						$JAVA_HOME/jre/lib/*jfx* \
+						$JAVA_HOME/jre/lib/amd64/libdecora_sse.so \
+						$JAVA_HOME/jre/lib/amd64/libprism_*.so \
+						$JAVA_HOME/jre/lib/amd64/libfxplugins.so \
+						$JAVA_HOME/jre/lib/amd64/libglass.so \
+						$JAVA_HOME/jre/lib/amd64/libgstreamer-lite.so \
+						$JAVA_HOME/jre/lib/amd64/libjavafx*.so \
+						$JAVA_HOME/jre/lib/amd64/libjfx*.so \
+	&& rm -rf /usr/share/locale/* \
+	&& yum remove -y perl \
+	&& yum clean all
+
+ENV GEODE_HOME /incubator-geode/gemfire-assembly/build/install/apache-geode
+ENV PATH $PATH:$GEODE_HOME/bin:$JAVA_HOME/bin
+
+# Default ports:
+# RMI/JMX 1099
+# REST 8080
+# PULE 7070
+# LOCATOR 10334
+# CACHESERVER 40404
+EXPOSE  8080 10334 40404 1099 7070
+VOLUME ["/data/"]
+CMD ["gfsh"]
+#ENTRYPOINT ["gfsh"]

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e0d7f46a/docker/README.md
----------------------------------------------------------------------
diff --git a/docker/README.md b/docker/README.md
new file mode 100644
index 0000000..4692940
--- /dev/null
+++ b/docker/README.md
@@ -0,0 +1,67 @@
+# Building the container image
+
+The current Dockerfile is based on a CentOS 6 image, downloads JDK 8, clone the Apache Geode git repository, starts a build and execute the basic tests.
+
+```
+docker build -t apachegeode/geode:unstable .
+```
+
+This may take a while depending on your internet connection, but it's worth since this is a one time step and you endup with a container that is tested and ready to be used for development. It will download Gradle and as part of the build, project dependencies as well.
+
+# Starting a locator and gfsh
+
+1. Then you can start gfsh as well in order to perform more commands:
+
+```
+docker run -it -p 10334:10334 -p 7575:7575 -p 1099:1099  apachegeode/geode:unstable gfsh
+```
+
+
+From this point you can pretty much follow [Apache Geode in 5 minutes](https://cwiki.apache.org/confluence/display/GEODE/Index#Index-Geodein5minutes) for example:
+
+```
+start server --name=server1
+```
+
+But in order to have real fun with containers you are probably better off using something like docker-compose or kubernetes. Those examples will come next.
+
+# Creating a cluster using multiple containers
+
+Install docker-compose following the instructions on this [link](https://docs.docker.com/compose/install/) and move into the composer directory.
+
+There is a docker-compose.yml example file there with a locator and a server.  To start the cluster execute:
+
+```
+docker-compose up
+```
+
+Or in order to start it in background:
+
+```
+docker-compose up -d
+```
+
+Do a docker ps and identify the container ID for the locator.  Now you can use *gfsh* on this container and connect to the distributed system:
+
+```
+docker exec -it <locator_container_id> gfsh
+gfsh>connect --locator=locator[10334]
+Connecting to Locator at [host=locator, port=10334] ..
+Connecting to Manager at [host=192.168.99.100, port=1099] ..
+Successfully connected to: [host=192.168.99.100, port=1099]
+
+gfsh>list members
+    Name     | Id
+    ------------ | --------------------------------------
+    locator      | locator(locator:33:locator)<v0>:1351
+    6e96cc0f6b72 | 172.17.1.92(6e96cc0f6b72:34)<v1>:28140
+```
+
+Type exit and now to scale the cluster you can leverage docker-compose scale command. For example:
+
+```
+docker-compose scale server=3
+```
+
+This will start 2 extra Geode server containers. You can verify this step by repeating the last GFSH step and listing the members.
+