feat: Use ubuntu for base image

This commit is contained in:
1ambda 2017-04-19 19:31:42 +09:00
parent 4d6485737c
commit 5cba56e025
2 changed files with 90 additions and 42 deletions

View file

@ -1,42 +0,0 @@
# 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 alpine:3.4
MAINTAINER Apache Software Foundation <dev@zeppelin.apache.org>
ENV JAVA_HOME /usr/lib/jvm/java-1.7-openjdk
ENV PATH $PATH:$JAVA_HOME/bin
RUN apk add --update bash curl openjdk7-jre wget ca-certificates python build-base make gcc g++ java-cacerts openssl && \
rm /usr/lib/jvm/java-1.7-openjdk/jre/lib/security/cacerts && \
ln -s /etc/ssl/certs/java/cacerts /usr/lib/jvm/java-1.7-openjdk/jre/lib/security/cacerts && \
curl --silent \
--location https://github.com/sgerrand/alpine-pkg-R/releases/download/3.3.1-r0/R-3.3.1-r0.apk --output /var/cache/apk/R-3.3.1-r0.apk && \
apk add --update --allow-untrusted /var/cache/apk/R-3.3.1-r0.apk && \
curl --silent \
--location https://github.com/sgerrand/alpine-pkg-R/releases/download/3.3.1-r0/R-dev-3.3.1-r0.apk --output /var/cache/apk/R-dev-3.3.1-r0.apk && \
apk add --update --allow-untrusted /var/cache/apk/R-dev-3.3.1-r0.apk && \
R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org')" && \
apk del curl build-base make gcc g++ && \
rm -rf /var/cache/apk/*
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64
RUN chmod +x /usr/local/bin/dumb-init
# ports for zeppelin
EXPOSE 8080 7077
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]

View file

@ -0,0 +1,90 @@
# 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 ubuntu:16.04
MAINTAINER Apache Software Foundation <dev@zeppelin.apache.org>
ENV LOG_TAG="[ZEPPELIN_BASE]:" \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
RUN echo "$LOG_TAG update and install basic packages" && \
apt-get -y update && \
apt-get install -y locales && \
locale-gen $LANG && \
apt-get install -y software-properties-common && \
apt -y autoclean && \
apt -y dist-upgrade && \
apt-get install -y build-essential
RUN echo "$LOG_TAG install tini related packages" && \
apt-get install -y curl grep sed dpkg && \
TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
dpkg -i tini.deb && \
rm tini.deb
ENV JAVA_HOME=/usr/lib/jvm/java-8-oracle
RUN echo "$LOG_TAG Install java8" && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get -y update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
# should install conda first before numpy, matploylib since pip and python will be installed by conda
RUN echo "$LOG_TAG Install miniconda3 related packages" && \
apt-get -y update && \
apt-get install -y bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
git mercurial subversion && \
echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda2-4.3.11-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh
ENV PATH /opt/conda/bin:$PATH
RUN echo "$LOG_TAG Install python related packages" && \
apt-get -y update && \
apt-get install -y python-dev python-pip && \
apt-get install -y gfortran && \
# numerical/algebra packages
apt-get install -y libblas-dev libatlas-dev liblapack-dev && \
# font, image for matplotlib
apt-get install -y libpng-dev libfreetype6-dev libxft-dev && \
# for tkinter
apt-get install -y python-tk libxml2-dev libxslt-dev zlib1g-dev && \
pip install numpy && \
pip install matplotlib
RUN echo "$LOG_TAG Install R related packages" && \
echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | tee -a /etc/apt/sources.list && \
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 && \
gpg -a --export E084DAB9 | apt-key add - && \
apt-get -y update && \
apt-get -y install r-base r-base-dev && \
R -e "install.packages('knitr', repos='http://cran.us.r-project.org')" && \
R -e "install.packages('ggplot2', repos='http://cran.us.r-project.org')" && \
R -e "install.packages('googleVis', repos='http://cran.us.r-project.org')" && \
R -e "install.packages('data.table', repos='http://cran.us.r-project.org')" && \
# for devtools, Rcpp
apt-get -y install libcurl4-gnutls-dev libssl-dev && \
R -e "install.packages('devtools', repos='http://cran.us.r-project.org')" && \
R -e "install.packages('Rcpp', repos='http://cran.us.r-project.org')" && \
Rscript -e "library('devtools'); library('Rcpp'); install_github('ramnathv/rCharts')"
ENTRYPOINT [ "/usr/bin/tini", "--" ]
CMD [ "/bin/bash" ]