forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-60: Scripts to build geode in a docker environment.
Contribution from Jun Aoki. Splitting the existing Dockerfile for running geode into a base Dockerfile, a Dockerfile for users to run geode, and a Dockerfile to compile geode and run tests within docker.
- Loading branch information
1 parent
1cb906c
commit 23cab23
Showing
8 changed files
with
234 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# 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 centos:centos7 | ||
MAINTAINER Geode Community <[email protected]> | ||
|
||
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 \ | ||
&& 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 \ | ||
jdk-8u51-linux-x64.tar.gz \ | ||
/usr/share/locale/* \ | ||
&& yum clean all | ||
|
||
ENV PATH $PATH:$JAVA_HOME/bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/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. | ||
|
||
set -e -x -u | ||
|
||
BASE_SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
|
||
export DOCKER_ENV_VERSION="0.1" | ||
export BASE_IMAGE_NAME="geode/base:${DOCKER_ENV_VERSION}" | ||
|
||
pushd ${BASE_SCRIPT_DIR} | ||
|
||
docker build --rm=true -t ${BASE_IMAGE_NAME} . | ||
|
||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 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 geode/base:0.1 | ||
MAINTAINER Geode Community <[email protected]> | ||
|
||
LABEL Vendor="Apache Geode (incubating)" | ||
LABEL version=unstable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/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. | ||
|
||
set -e -x -u | ||
|
||
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
|
||
source ${SCRIPT_DIR}/../base/build-base-docker.sh | ||
|
||
IMAGE_NAME="geode/compile:${DOCKER_ENV_VERSION}" | ||
|
||
pushd ${SCRIPT_DIR} | ||
|
||
docker build -t ${IMAGE_NAME} . | ||
|
||
popd | ||
|
||
if [ "$(uname -s)" == "Linux" ]; then | ||
USER_NAME=${SUDO_USER:=$USER} | ||
USER_ID=$(id -u "${USER_NAME}") | ||
GROUP_ID=$(id -g "${USER_NAME}") | ||
else # boot2docker uid and gid | ||
USER_NAME=$USER | ||
USER_ID=1000 | ||
GROUP_ID=50 | ||
fi | ||
|
||
docker build -t "${IMAGE_NAME}-${USER_NAME}" - <<UserSpecificDocker | ||
FROM ${IMAGE_NAME} | ||
RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME} | ||
RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME} | ||
ENV HOME /home/${USER_NAME} | ||
UserSpecificDocker | ||
|
||
# Go to root | ||
pushd ${SCRIPT_DIR}/../../.. | ||
|
||
docker run -i -t \ | ||
--rm=true \ | ||
-w "/home/${USER_NAME}/incubator-geode" \ | ||
-u "${USER_NAME}" \ | ||
-v "$PWD:/home/${USER_NAME}/incubator-geode" \ | ||
-v "/home/${USER_NAME}/.m2:/home/${USER_NAME}/.m2" \ | ||
${IMAGE_NAME}-${USER_NAME} \ | ||
bash | ||
|
||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,38 @@ | ||
FROM centos:latest | ||
MAINTAINER William Markito <[email protected]> | ||
# 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 geode/base:0.1 | ||
MAINTAINER Geode Community <[email protected]> | ||
|
||
LABEL Vendor="Apache Geode (incubating)" | ||
LABEL version=unstable | ||
|
||
# download JDK 8 | ||
ENV JAVA_HOME /jdk1.8.0_51 | ||
# 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 \ | ||
RUN 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 | ||
&& yum remove -y perl | ||
|
||
ENV GEODE_HOME /incubator-geode/gemfire-assembly/build/install/apache-geode | ||
ENV PATH $PATH:$GEODE_HOME/bin:$JAVA_HOME/bin | ||
ENV PATH $PATH:$GEODE_HOME/bin | ||
|
||
# Default ports: | ||
# RMI/JMX 1099 | ||
|
@@ -53,4 +43,4 @@ ENV PATH $PATH:$GEODE_HOME/bin:$JAVA_HOME/bin | |
EXPOSE 8080 10334 40404 1099 7070 | ||
VOLUME ["/data/"] | ||
CMD ["gfsh"] | ||
#ENTRYPOINT ["gfsh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/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. | ||
|
||
set -e -x -u | ||
|
||
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
|
||
source ${SCRIPT_DIR}/../dev-tools/docker/base/build-base-docker.sh | ||
|
||
IMAGE_NAME="geode/runtime:${DOCKER_ENV_VERSION}" | ||
|
||
pushd ${SCRIPT_DIR} | ||
|
||
# Build runtime image | ||
docker build --rm=true -t ${IMAGE_NAME} . | ||
|
||
popd | ||
|