Skip to content

Commit

Permalink
Updating and cleaning up Dockerfile for 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
William Markito committed Oct 28, 2016
1 parent 3ff33be commit b566a46
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 83 deletions.
26 changes: 17 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM geode/base:0.1
MAINTAINER Geode Community <[email protected]>
FROM centos:7
MAINTAINER Apache Geode Community <[email protected]>

LABEL Vendor="Apache Geode (incubating)"
LABEL version=unstable
LABEL version=1.0.0

# download JDK 8
# ENV JAVA_HOME /jdk1.8.0_51
ENV JAVA_HOME /jdk1.8.0_111

RUN git clone -b develop https://github.com/apache/incubator-geode.git \
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/8u111-b14/jdk-8u111-linux-x64.tar.gz" \
&& tar xf jdk-8u111-linux-x64.tar.gz \
&& git clone https://github.com/apache/incubator-geode.git \
&& cd incubator-geode \
&& ./gradlew build -Dskip.tests=true \
&& git checkout rel/v1.0.0-incubating \
&& ./gradlew build -Dskip.tests=true -xjavadoc \
&& ls /incubator-geode | grep -v geode-assembly | xargs rm -rf \
&& rm -rf /root/.gradle/ \
&& rm -rf /incubator-geode/geode-assembly/build/distributions/ \
&& yum remove -y perl
&& rm -rf /jdk-8u111-linux-x64.tar.gz \
&& rm -rf /jdk1.8.0_111/lib/missioncontrol/* \
&& rm -rf /jdk1.8.0_111/lib/visualvm/* \
&& rm -rf /usr/share/locale/* \
&& yum remove -y perl \
&& yum clean all

ENV GEODE_HOME /incubator-geode/geode-assembly/build/install/apache-geode
ENV PATH $PATH:$GEODE_HOME/bin
ENV PATH $PATH:$GEODE_HOME/bin:$JAVA_HOME/bin

# Default ports:
# RMI/JMX 1099
Expand All @@ -43,4 +52,3 @@ ENV PATH $PATH:$GEODE_HOME/bin
EXPOSE 8080 10334 40404 1099 7070
VOLUME ["/data/"]
CMD ["gfsh"]

56 changes: 14 additions & 42 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,37 @@
The current Dockerfile is based on a CentOS 7 image, downloads JDK 8, clone the Apache Geode git repository, starts a build and execute the basic tests.

```
./build-runtime-docker.sh
docker build .
```

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 --rm=true -it -p 10334:10334 -p 7575:7575 -p 1099:1099 geode/runtime:0.1 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:
If you're updating the image for a release, tag the build with the version:

```
start server --name=server1
docker build -t apachegeode/geode:1.0.0-incubating .
```

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:
Once it's tagged, push to DockerHub:

```
docker-compose up
docker push apachegeode/geode:1.0.0-incubating
```

Or in order to start it in background:
* You need to be authenticated in DockerHub and be an administrator of the project. Ask for permissions at *[email protected]*.
* This may take a while depending on your internet connection.

```
docker-compose up -d
```
# Starting a locator and gfsh

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:
1. Execute the following command to run the container and start `gfsh`:

```
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
docker run -it -p 10334:10334 -p 7575:7575 -p 1099:1099 apache/geode:1.0.0-incubating
```

Type exit and now to scale the cluster you can leverage docker-compose scale command. For example:
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:

```
docker-compose scale server=3
gfsh> start locator --name=locator
gfsh> start server --name=server
```

This will start 2 extra Geode server containers. You can verify this step by repeating the last GFSH step and listing the members.

But in order to have real fun with containers you are probably better off using something like docker-compose, Cloud foundry or Kubernetes. Those examples will come next.
32 changes: 0 additions & 32 deletions docker/build-runtime-docker.sh

This file was deleted.

0 comments on commit b566a46

Please sign in to comment.