forked from geodocker/geodocker-jupyter-geopyspark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.stage2
50 lines (41 loc) · 1.84 KB
/
Dockerfile.stage2
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
FROM quay.io/geodocker/jupyter:4
ARG VERSION
ARG GEONOTEBOOKSHA
ARG GDALBLOB
ARG PYTHONBLOB1
ARG PYTHONBLOB2
ENV LD_LIBRARY_PATH /home/hadoop/local/gdal/lib
ENV PYSPARK_PYTHON=python3.4
ENV PYSPARK_DRIVER_PYTHON=python3.4
# Install extraction script
COPY scripts/extract-blob.sh /scripts/
# Install Python dependencies
COPY blobs/$GDALBLOB /blobs/
COPY blobs/$PYTHONBLOB1 /blobs/
COPY scripts/install-blob1.sh /scripts/
RUN pip3 install --user pytest && /scripts/install-blob1.sh $GDALBLOB $PYTHONBLOB1
# Install remaining GeoNotebook dependencies
COPY config/requirements.txt /tmp/requirements.txt
RUN pip3 install --user -r /tmp/requirements.txt && \
pip3 install --user "https://github.com/OpenGeoscience/ktile/archive/6f134e86f90242c8393fe1912435a5fb99c6256d.zip"
# Install GeoNotebook
COPY blobs/geonotebook-$GEONOTEBOOKSHA.zip /tmp
RUN mkdir /home/hadoop/notebooks && \
(pushd /tmp ; unzip -q geonotebook-$GEONOTEBOOKSHA.zip ; popd) && \
(pushd /tmp/geonotebook-$GEONOTEBOOKSHA ; pip3 install --user . ; popd) && \
jupyter nbextension enable --py widgetsnbextension && \
jupyter serverextension enable --py geonotebook && \
jupyter nbextension enable --py geonotebook
COPY config/geonotebook.ini /home/hadoop/.local/etc/geonotebook.ini
COPY kernels/geonotebook/kernel.json /home/hadoop/.local/share/jupyter/kernels/geonotebook3/kernel.json
COPY kernels/local/kernel.json /usr/local/share/jupyter/kernels/pyspark/
COPY kernels/yarn/kernel.json /usr/local/share/jupyter/kernels/pysparkyarn/
# Install GeoPySpark
COPY blobs/$PYTHONBLOB2 /blobs/
COPY scripts/install-blob2.sh /scripts/
RUN /scripts/install-blob2.sh $PYTHONBLOB2
# Install Jars
COPY blobs/geotrellis-backend-assembly-$VERSION.jar /opt/jars/
COPY blobs/gddp-assembly-$VERSION.jar /opt/jars/
WORKDIR /tmp
CMD ["jupyterhub", "--no-ssl", "--Spawner.notebook_dir=/home/hadoop/notebooks"]