-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Dockerfile
83 lines (72 loc) · 3.71 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
# 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 zeppelin-distribution:latest AS zeppelin-distribution
FROM ubuntu:20.04
LABEL maintainer="Apache Software Foundation <dev@zeppelin.apache.org>"
ARG version="0.9.0-SNAPSHOT"
ENV VERSION="${version}" \
Z_HOME="/opt/zeppelin"
RUN set -ex && \
apt-get -y update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y openjdk-8-jre-headless wget && \
# Cleanup
rm -rf /var/lib/apt/lists/* && \
apt-get autoclean && \
apt-get clean
COPY --from=zeppelin-distribution /opt/zeppelin/bin ${Z_HOME}/bin
COPY log4j.properties ${Z_HOME}/conf/
COPY log4j_yarn_cluster.properties ${Z_HOME}/conf/
# Decide:
## 1) Build a huge image with all interpreters (default)
COPY --from=zeppelin-distribution /opt/zeppelin/interpreter ${Z_HOME}/interpreter
## 2) Build an image with only some interpreters
#### Copy interpreter-shaded JAR, needed for all interpreters
### COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar ${Z_HOME}/interpreter/zeppelin-interpreter-shaded-${VERSION}.jar
#### Copy specific interpreters, replace "${interpreter_name}" with your interpreter. Of course you can repeat the line with defferent interpreter
### COPY --from=zeppelin-distribution /opt/zeppelin/interpreter/${interpreter_name} ${Z_HOME}/interpreter/${interpreter_name}
# Decide: Install conda to manage python and R packages
ARG miniconda_version="py37_4.8.2"
ARG miniconda_sha256="957d2f0f0701c3d1335e3b39f235d197837ad69a944fa6f5d8ad2c686b69df3b"
# Install python packages via conda
COPY python_conda_packages.txt /python_conda_packages.txt
# Some python packages are not available via conda, so we are using pip
COPY pip_packages.txt /pip_packages.txt
# Install R packages via condo
COPY r_conda_packages.txt /r_conda_packages.txt
RUN set -ex && \
wget -nv https://repo.anaconda.com/miniconda/Miniconda3-${miniconda_version}-Linux-x86_64.sh -O miniconda.sh && \
echo "${miniconda_sha256} miniconda.sh" > anaconda.sha256 && \
sha256sum --strict -c anaconda.sha256 && \
bash miniconda.sh -b -p /opt/conda && \
export PATH=/opt/conda/bin:$PATH && \
conda config --set always_yes yes --set changeps1 no && \
conda info -a && \
conda config --add channels conda-forge && \
conda install -y --quiet --file /python_conda_packages.txt && \
pip install -q -r /pip_packages.txt && \
conda install -y --quiet --file /r_conda_packages.txt && \
# Cleanup
rm -v miniconda.sh anaconda.sha256 && \
# Cleanup based on https://github.com/ContinuumIO/docker-images/commit/cac3352bf21a26fa0b97925b578fb24a0fe8c383
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
conda clean -ay && \
# Allow to modify conda packages
chmod -R ug+rwX /opt/conda
ENV PATH /opt/conda/bin:$PATH
# Allow process to edit /etc/passwd, to create a user entry for zeppelin
RUN chgrp root /etc/passwd && chmod ug+rw /etc/passwd
USER 1000
WORKDIR ${Z_HOME}