forked from steveny2k/docker-predictionio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (69 loc) · 3.72 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
FROM ubuntu
MAINTAINER Steven Yan
ENV PIO_VERSION 0.10.0
ENV SPARK_VERSION 1.5.1
ENV ELASTICSEARCH_VERSION 1.4.4
ENV HBASE_VERSION 1.0.0
ENV PIO_HOME /PredictionIO-${PIO_VERSION}-incubating
ENV PATH=${PIO_HOME}/bin:$PATH
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
RUN apt-get update \
&& apt-get install -y --auto-remove --no-install-recommends curl maven openjdk-8-jdk libgfortran3 python-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -O http://mirror.nexcess.net/apache/incubator/predictionio/${PIO_VERSION}-incubating/apache-predictionio-${PIO_VERSION}-incubating.tar.gz \
&& tar -xvzf apache-predictionio-${PIO_VERSION}-incubating.tar.gz -C / \
&& rm apache-predictionio-${PIO_VERSION}-incubating.tar.gz \
&& cd apache-predictionio-${PIO_VERSION}-incubating \
&& ./make-distribution.sh
RUN tar zxvf /apache-predictionio-${PIO_VERSION}-incubating/PredictionIO-${PIO_VERSION}-incubating.tar.gz -C /
RUN rm -r /apache-predictionio-${PIO_VERSION}-incubating
RUN mkdir /${PIO_HOME}/vendors
COPY files/pio-env.sh ${PIO_HOME}/conf/pio-env.sh
RUN curl -O http://d3kbcqa49mib13.cloudfront.net/spark-${SPARK_VERSION}-bin-hadoop2.6.tgz \
&& tar -xvzf spark-${SPARK_VERSION}-bin-hadoop2.6.tgz -C ${PIO_HOME}/vendors \
&& rm spark-${SPARK_VERSION}-bin-hadoop2.6.tgz
RUN curl -O https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz \
&& tar -xvzf elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz -C ${PIO_HOME}/vendors \
&& rm elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz \
&& echo 'cluster.name: predictionio' >> ${PIO_HOME}/vendors/elasticsearch-${ELASTICSEARCH_VERSION}/config/elasticsearch.yml \
&& echo 'network.host: 127.0.0.1' >> ${PIO_HOME}/vendors/elasticsearch-${ELASTICSEARCH_VERSION}/config/elasticsearch.yml
RUN curl -O http://archive.apache.org/dist/hbase/hbase-${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz \
&& tar -xvzf hbase-${HBASE_VERSION}-bin.tar.gz -C ${PIO_HOME}/vendors \
&& rm hbase-${HBASE_VERSION}-bin.tar.gz
COPY files/hbase-site.xml ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml
RUN sed -i "s|VAR_PIO_HOME|${PIO_HOME}|" ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml \
&& sed -i "s|VAR_HBASE_VERSION|${HBASE_VERSION}|" ${PIO_HOME}/vendors/hbase-${HBASE_VERSION}/conf/hbase-site.xml
RUN pip install --upgrade pip
RUN pip install -U setuptools
RUN pip install predictionio datetime
RUN apt-get update && apt-get install -y git
# Build Mahout (Temporary But Necessary)
RUN git clone https://github.com/apache/mahout.git mahout
RUN cd mahout;git checkout 00a2883ec69b0807a5486c61dfcc7ef27f35ddc6
RUN cd mahout;mvn clean install -DskipTests
# Build The Universal Recommender
RUN git clone https://github.com/actionml/universal-recommender.git ~/ur
RUN apt-get update && apt-get install -y vim sudo
#prepare example: Similar Product Engine Template
#(http://predictionio.incubator.apache.org/templates/similarproduct/quickstart/)
#RUN pio template get apache/incubator-predictionio-template-similar-product MySimilarProduct
#RUN cd MySimilarProduct
#RUN pio app new MyApp1
#
#RUN pip install -U setuptools
#RUN pip install predictionio
#prepare example: Demo-Tapster
#RUN apt-get install git ruby build-essential make
#RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
#RUN curl -L https://get.rvm.io | bash -s stable
#RUN touch ~/.bash_profile
#RUN export PATH=$PATH:/usr/local/rvm/bin:/usr/local/rvm/sbin
#RUN source ~/.bash_profile
#RUN rvm install ruby-2.2.2
#RUN ln -s /usr/local/rvm/rubies/ruby-2.2.2/bin/ruby /usr/bin/ruby
#
#RUN gem install bundler
#RUN git clone https://github.com/PredictionIO/Demo-Tapster.git
#RUN cd Demo-Tapster
#RUN bundle install