Dockerfile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Licensed under the Apache License, Version 2.0 (the "License");
  2. # you may not use this file except in compliance with the License.
  3. # You may obtain a copy of the License at
  4. #
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. #
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. FROM centos:centos6
  13. RUN echo root:changeme | chpasswd
  14. RUN yum clean all -y && yum update -y
  15. RUN yum -y install vim wget rpm-build sudo which telnet tar openssh-server openssh-clients ntp git python-setuptools python-devel httpd lsof
  16. RUN rpm -e --nodeps --justdb glibc-common
  17. RUN yum -y install glibc-common
  18. ENV HOME /root
  19. #Install JAVA
  20. 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
  21. RUN rpm -ivh jdk-7u55-linux-x64.rpm
  22. ENV JAVA_HOME /usr/java/default/
  23. #Install Maven
  24. RUN mkdir -p /opt/maven
  25. WORKDIR /opt/maven
  26. RUN wget http://archive.apache.org/dist/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
  27. RUN tar -xvzf /opt/maven/apache-maven-3.0.5-bin.tar.gz
  28. RUN rm -rf /opt/maven/apache-maven-3.0.5-bin.tar.gz
  29. ENV M2_HOME /opt/maven/apache-maven-3.0.5
  30. ENV MAVEN_OPTS -Xmx2048m -XX:MaxPermSize=256m
  31. ENV PATH $PATH:$JAVA_HOME/bin:$M2_HOME/bin
  32. # SSH key
  33. RUN ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
  34. RUN cat /root/.ssh/id_rsa.pub > /root/.ssh/authorized_keys
  35. RUN chmod 600 /root/.ssh/authorized_keys
  36. RUN sed -ri 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
  37. #To allow bower install behind proxy. See https://github.com/bower/bower/issues/731
  38. RUN git config --global url."https://".insteadOf git://
  39. # Install python, nodejs and npm
  40. RUN yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  41. RUN yum -y install nodejs npm --enablerepo=epel
  42. RUN npm install -g npm@2.1.11
  43. RUN npm install -g brunch@1.7.20
  44. # Install Solr
  45. ENV SOLR_VERSION 5.5.2
  46. RUN wget --no-check-certificate -O /root/solr-$SOLR_VERSION.tgz http://archive.apache.org/dist/lucene/solr/$SOLR_VERSION/solr-$SOLR_VERSION.tgz
  47. RUN cd /root && tar -zxvf /root/solr-$SOLR_VERSION.tgz
  48. ADD bin/start.sh /root/start.sh
  49. ADD test-config /root/test-config
  50. ADD test-logs /root/test-logs
  51. RUN chmod -R 777 /root/test-config
  52. RUN chmod +x /root/start.sh
  53. ENV SOLR_CONFIG_LOCATION /root/config/solr
  54. ENV LOGSEARCH_CONFIG_LOCATION /root/config/logsearch
  55. ENV LOGFEEDER_CONFIG_LOCATION /root/config/logfeeder
  56. ENV SOLR_INCLUDE /root/config/solr/solr-env.sh
  57. ENV LOGSEARCH_INCLUDE /root/config/logsearch/logsearch-env.sh
  58. ENV LOGFEEDER_INCLUDE /root/config/logfeeder/logfeeder-env.sh
  59. RUN mkdir -p /var/run/ambari-logsearch-solr /var/log/ambari-logsearch-solr /var/run/ambari-logsearch-solr-client \
  60. /var/log/ambari-logsearch-solr-client /root/logsearch_solr_index/data \
  61. /var/run/ambari-logsearch-portal /var/log/ambari-logsearch-portal \
  62. /var/run/ambari-logsearch-logfeeder /var/log/ambari-logsearch-logfeeder
  63. RUN cp /root/test-config/solr/solr.xml /root/logsearch_solr_index/data
  64. RUN cp /root/test-config/solr/zoo.cfg /root/logsearch_solr_index/data
  65. WORKDIR /root
  66. CMD /root/start.sh