Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 6b3d952

Browse files
zybingcarsonwang
authored andcommitted
Modify docker module errors and deploy docker image on openjdk (#288)
* docker on openjdk * hibench docker on openjdk * modify docker script * add runexample.sh for opensource * change directory error * change spark version * build all * set opensource docker and cdh docker different name * modify run-container * support jdk 8 * remove bin/bash for some file
1 parent be0a14a commit 6b3d952

20 files changed

Lines changed: 78 additions & 48 deletions

docker/base/base-core

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
USER root
33

44
## add proxy config inside FIREWALL
5-
65
#==============================
76
# System Basic Tools Installation
87
#==============================
@@ -54,15 +53,12 @@ RUN apt-get install -y python-numpy python-matplotlib
5453

5554
# Install Java
5655
RUN \
57-
echo oracle-java${JDK_VERSION}-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
58-
add-apt-repository -y ppa:webupd8team/java && \
56+
add-apt-repository -y ppa:openjdk-r/ppa && \
5957
apt-get update && \
60-
apt-get install -y oracle-java${JDK_VERSION}-installer && \
61-
rm -rf /var/lib/apt/lists/* && \
62-
rm -rf /var/cache/oracle-jdk${JDK_VERSION}-installer
58+
apt-get install -y openjdk-${JDK_VERSION}-jdk
6359

6460
# Define commonly used JAVA_HOME variable
65-
ENV JAVA_HOME /usr/lib/jvm/java-${JDK_VERSION}-oracle
61+
ENV JAVA_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64
6662
ENV PATH $PATH:$JAVA_HOME/bin
6763

6864

@@ -102,6 +98,9 @@ RUN mv apache-maven-* /usr/local/apache-maven
10298
# define environment variables for maven
10399
ENV M2_HOME /usr/local/apache-maven
104100
ENV PATH $PATH:/usr/local/apache-maven/bin
101+
# copy local maven repository to docker image
102+
#RUN rm -rf /root/.m2
103+
#ADD .m2 /root/.m2
105104

106105

107106
#==============================
@@ -119,5 +118,9 @@ RUN mv /root/HiBench* ${HIBENCH_HOME}
119118
RUN rm -f HiBench-${HIBENCH_VERSION}.zip
120119
COPY conf/99-user_defined_properties.conf ${HIBENCH_HOME}/conf/
121120
# start building HiBench
121+
RUN apt-get update && apt-get install -y thrift-compiler
122+
#RUN cd ${HIBENCH_HOME}/src && \
123+
#mvn clean package -D spark1.5 -D MR2
124+
# /bin/build-all.sh can be used to built hibench for all known Spark and MR versions
122125
RUN ${HIBENCH_HOME}/bin/build-all.sh
123126

docker/cdh-docker/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ COPY scripts/hadoop-env.sh /etc/hadoop/conf/hadoop-env.sh
6060
#Format HDFS
6161
COPY scripts/restart-hadoop-spark.sh /usr/bin/restart-hadoop-spark.sh
6262
RUN chmod +x /usr/bin/restart-hadoop-spark.sh
63-
64-
# start HADOOP/SPARK
65-
CMD bash -C '/usr/bin/restart-hadoop-spark.sh'; 'bash'
63+
#Copy RunExample File
64+
COPY scripts/runexample.sh /root/runexample.sh
65+
RUN chmod +x /root/runexample.sh

docker/cdh-docker/conf/core-site.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!--
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -12,11 +13,9 @@
1213
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
16+
-->
1517

1618

17-
<?xml version="1.0"?>
18-
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19-
2019
<configuration>
2120

2221
<!--

docker/cdh-docker/conf/hdfs-site.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!--
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -12,11 +13,9 @@
1213
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
16+
-->
1517

1618

17-
<?xml version="1.0"?>
18-
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19-
2019
<configuration>
2120

2221
<property>

docker/cdh-docker/conf/mapred-site.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!--
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -12,11 +13,9 @@
1213
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
16+
-->
1517

1618

17-
<?xml version="1.0"?>
18-
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19-
2019
<configuration>
2120

2221
<property>

docker/cdh-docker/conf/yarn-site.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!--
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -12,11 +13,9 @@
1213
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1314
# See the License for the specific language governing permissions and
1415
# limitations under the License.
16+
-->
1517

1618

17-
<?xml version="1.0"?>
18-
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
19-
2019
<configuration>
2120

2221
<property>

docker/cdh-docker/scripts/hadoop-env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -14,10 +15,9 @@
1415
# limitations under the License.
1516

1617

17-
#!/bin/bash
1818

1919
export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true $HADOOP_CLIENT_OPTS"
20-
export JAVA_HOME="/usr/lib/jvm/java-7-oracle"
20+
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
2121

2222
export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}/lib/native
2323
export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib"

docker/cdh-docker/scripts/restart-hadoop-spark.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# Licensed to the Apache Software Foundation (ASF) under one or more
23
# contributor license agreements. See the NOTICE file distributed with
34
# this work for additional information regarding copyright ownership.
@@ -14,7 +15,6 @@
1415
# limitations under the License.
1516

1617

17-
#!/bin/bash
1818

1919
# start ssh service
2020
service ssh restart
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
#modify etc/hosts file to avoid connection error
4+
cp /etc/hosts /etc/hostsbak
5+
sed -i 's/::1/#::1/' /etc/hostsbak
6+
cat /etc/hostsbak > /etc/hosts
7+
rm -rf /etc/hostsbak
8+
#run wordcount example
9+
/usr/bin/restart-hadoop-spark.sh
10+
${HIBENCH_HOME}/workloads/wordcount/prepare/prepare.sh
11+
${HIBENCH_HOME}/workloads/wordcount/mapreduce/bin/run.sh

docker/hibench-docker.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ OS_VERSION 14.04
3131
PYTHON_VERSION 2.7
3232
JDK_VERSION 7
3333
SCALA_VERSION 2.10.5
34-
MAVEN_VERSION 3.1.0
34+
MAVEN_VERSION 3.0.5
3535
HIBENCH_VERSION 5.0
3636

3737

@@ -40,8 +40,8 @@ HIBENCH_VERSION 5.0
4040
#=========================#
4141
HADOOP_VERSION hadoop2
4242
HADOOP_VERSION_DETAIL 2.5.0
43-
SPARK_VERSION spark1.3
44-
SPARK_VERSION_DETAIL 1.3.0
43+
SPARK_VERSION spark1.5
44+
SPARK_VERSION_DETAIL 1.5.2
4545
HADOOP_FOR_SPARK_VERSION 2.4
4646

4747

0 commit comments

Comments
 (0)