-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
96 lines (83 loc) · 4.45 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
85
86
87
88
89
90
91
92
93
94
95
96
#
# Aerospike Server Dockerfile
#
# http://github.com/aerospike/aerospike-server.docker
#
# This docker file is compatible with Aerospike Community Edition. It provides Java and Python environments and access to the Aerospike DB.
FROM jupyter/base-notebook:python-3.8.6
USER root
ENV AEROSPIKE_VERSION 7.2.0.4
ENV AEROSPIKE_SHA256 f742ad19d6a75901134e8a6a9a8c9bba9830b019c06053145ad56d8d1b189af8
ENV LOGFILE /var/log/aerospike/aerospike.log
ARG AEROSPIKE_TOOLS_VERSION=11.1.1
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
USER root
RUN chown -R ${NB_UID} ${HOME}
# spark notebook
RUN mkdir /opt/spark-nb; cd /opt/spark-nb\
&& wget -qO- "https://archive.apache.org/dist/spark/spark-3.4.0/spark-3.4.0-bin-hadoop3-scala2.13.tgz" | tar -xvz \
&& ln -s spark-3.4.0-bin-hadoop3-scala2.13 spark-dir-link \
&& pip install findspark numpy pandas matplotlib sklearn \
&& wget "https://download.aerospike.com/artifacts/aerospike-spark/4.5.1/aerospike-spark-4.5.1-spark3.4-scala2.13-clientunshaded.jar" \
&& ln -s aerospike-spark-4.5.1-spark3.4-scala2.13-clientunshaded.jar aerospike-jar-link
# install jupyter notebook extensions, and enable these extensions by default: table of content, collapsible headers, and scratchpad
RUN pip install jupyter_contrib_nbextensions\
&& jupyter contrib nbextension install --sys-prefix\
&& jupyter nbextension enable toc2/main --sys-prefix\
&& jupyter nbextension enable collapsible_headings/main --sys-prefix\
&& jupyter nbextension enable scratchpad/main --sys-prefix
RUN mkdir /var/run/aerospike\
&& apt-get update -y \
&& apt-get install software-properties-common dirmngr gpg-agent -y --no-install-recommends\
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9 \
&& apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main' \
&& apt-get install -y --no-install-recommends build-essential wget lua5.2 gettext-base libldap-dev curl unzip python python3-pip python3-dev python3 zulu-11\
&& wget "https://www.aerospike.com/artifacts/aerospike-server-enterprise/${AEROSPIKE_VERSION}/aerospike-server-enterprise_${AEROSPIKE_VERSION}_tools-${AEROSPIKE_TOOLS_VERSION}_ubuntu20.04_x86_64.tgz" -O aerospike-server.tgz \
&& echo "$AEROSPIKE_SHA256 *aerospike-server.tgz" | sha256sum -c - \
&& wget "https://github.com/aerospike/aerospike-loader/releases/download/4.0.3/aerospike-load-4.0.3-jar-with-dependencies.jar" \
&& mkdir aerospike \
&& tar xzf aerospike-server.tgz --strip-components=1 -C aerospike \
&& dpkg -i aerospike/aerospike-server*.deb \
&& dpkg -i aerospike/aerospike-tools*.deb \
&& mkdir -p /opt/aerospike/lib/java \
&& mv aerospike-load-*-jar-with-dependencies.jar /opt/aerospike/lib/java/ \
&& pip install --no-cache-dir aerospike\
&& pip install --no-cache-dir pymongo\
&& wget "https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip" -O ijava-kernel.zip\
&& unzip ijava-kernel.zip -d ijava-kernel \
&& python3 ijava-kernel/install.py --sys-prefix\
&& rm ijava-kernel.zip\
&& rm -rf aerospike-server.tgz aerospike /var/lib/apt/lists/* \
&& apt-get purge -y \
&& apt autoremove -y \
&& mkdir -p /var/log/aerospike
COPY aerospike /etc/init.d/
RUN usermod -a -G aerospike ${NB_USER}
# Add the Aerospike configuration specific to this dockerfile
COPY aerospike.template.conf /etc/aerospike/aerospike.template.conf
COPY aerospike.conf /etc/aerospike/aerospike.conf
COPY features.conf /etc/aerospike/features.conf
RUN chown -R ${NB_UID} /etc/aerospike
RUN chown -R ${NB_UID} /opt/aerospike
RUN chown -R ${NB_UID} /var/log/aerospike
RUN chown -R ${NB_UID} /var/run/aerospike
#RUN fix-permissions /etc/aerospike/
#RUN fix-permissions /var/log/aerospike
COPY notebooks* /home/${NB_USER}/notebooks
RUN echo "Versions:" > /home/${NB_USER}/notebooks/README.md
RUN python -V >> /home/${NB_USER}/notebooks/README.md
RUN java -version 2>> /home/${NB_USER}/notebooks/README.md
RUN asd --version >> /home/${NB_USER}/notebooks/README.md
RUN echo -e "Aerospike Python Client `pip show aerospike|grep Version|sed -e 's/Version://g'`" >> /home/${NB_USER}/notebooks/README.md
#RUN echo -e "Aerospike Java Client 5.0.0" >> /home/${NB_USER}/notebooks/README.md
COPY jupyter_notebook_config.py /home/${NB_USER}/
RUN fix-permissions /home/${NB_USER}/
# I don't know why this has to be like this
# rather than overiding
COPY entrypoint.sh /usr/local/bin/start-notebook.sh
WORKDIR /home/${NB_USER}/notebooks
USER ${NB_USER}