From 8bbacc291e13cd5312c18d91228421ecaef23444 Mon Sep 17 00:00:00 2001 From: Sandor Magyari Date: Mon, 24 Aug 2015 16:10:13 +0200 Subject: [PATCH] update Docker file --- dev-support/docker/docker/Dockerfile | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/dev-support/docker/docker/Dockerfile b/dev-support/docker/docker/Dockerfile index 701ed6e3b14..14977351bca 100644 --- a/dev-support/docker/docker/Dockerfile +++ b/dev-support/docker/docker/Dockerfile @@ -16,7 +16,7 @@ RUN echo root:changeme | chpasswd ## Install some basic utilities that aren't in the default image RUN yum clean all -y && yum update -y -RUN yum -y install vim wget rpm-build sudo which telnet tar openssh-server openssh-clients ntp git python-setuptools httpd +RUN yum -y install vim wget rpm-build sudo which telnet tar openssh-server openssh-clients ntp git python-devel python-setuptools httpd # phantomjs dependency RUN yum -y install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6 RUN rpm -e --nodeps --justdb glibc-common @@ -25,11 +25,11 @@ RUN yum -y install glibc-common ENV HOME /root #Install JAVA -# RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm -O jdk-7u55-linux-x64.rpm -# RUN yum -y install jdk-7u55-linux-x64.rpm -RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin -O jdk-6u45-linux-x64-rpm.bin -RUN chmod +x jdk-6u45-linux-x64-rpm.bin -RUN ./jdk-6u45-linux-x64-rpm.bin +RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u55-b13/jdk-7u55-linux-x64.rpm -O jdk-7u55-linux-x64.rpm +RUN yum -y install jdk-7u55-linux-x64.rpm +# RUN wget --no-check-certificate --no-cookies --header "Cookie:oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin -O jdk-6u45-linux-x64-rpm.bin +# RUN chmod +x jdk-6u45-linux-x64-rpm.bin +# RUN ./jdk-7u55-linux-x64-rpm.bin ENV JAVA_HOME /usr/java/default/ #Install Maven @@ -42,7 +42,7 @@ RUN rm -rf /opt/maven/apache-maven-3.0.5-bin.tar.gz ENV M2_HOME /opt/maven/apache-maven-3.0.5 ENV MAVEN_OPTS -Xmx2048m -XX:MaxPermSize=256m ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin - +ENV AMBARI_VERSION=2.1.0.0 # SSH key RUN ssh-keygen -f /root/.ssh/id_rsa -t rsa -N '' @@ -53,23 +53,30 @@ RUN sed -ri 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config # Install python, nodejs and npm RUN yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm RUN yum -y install nodejs npm --enablerepo=epel -RUN npm install -g brunch@1.7.13 +RUN npm install -g brunch@1.7.17 + +RUN touch /etc/yum.repos.d/ambari.repo # Once run some mvn commands to cache .m2/repository WORKDIR /tmp -RUN git clone https://github.com/apache/ambari.git +RUN git clone https://git-wip-us.apache.org/repos/asf/ambari.git WORKDIR /tmp/ambari -RUN mvn versions:set -DnewVersion=1.6.1.0 -RUN mvn -B clean install package rpm:rpm -DskipTests -DnewVersion=1.6.1.0 -Dpython.ver="python >= 2.6" -Preplaceurl +RUN mvn versions:set -DnewVersion=$AMBARI_VERSION + +# Note: The ambari-metrics project is not wired up to the main ambari project. However there is a dependency on ambari-metrics-common to build the ambari-server RPM. +# Hence you also need to set ambari-metrics project version as well. +WORKDIR /tmp/ambari/ambari-metrics +RUN mvn versions:set -DnewVersion=$AMBARI_VERSION + +WORKDIR /tmp/ambari +RUN mvn -B clean install package rpm:rpm -DskipTests -DnewVersion=$AMBARI_VERSION -Dpython.ver="python >= 2.6" -Preplaceurl # clean git code because I want to use the one on local filesystem. WORKDIR /tmp -RUN rm -rf /tmp/ambari +#RUN rm -rf /tmp/ambari RUN mkdir -p /tmp/ambari-build-docker/blueprints ADD ./blueprints /tmp/ambari-build-docker/blueprints RUN mkdir -p /tmp/ambari-build-docker/bin ADD ./bin /tmp/ambari-build-docker/bin -WORKDIR /tmp -