forked from ESA-PhiLab/OpenSarToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
81 lines (69 loc) · 2.15 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
ARG BASE_CONTAINER=jupyter/scipy-notebook:7a3e968dd212
FROM $BASE_CONTAINER
USER root
ENV HOME=/home/$NB_USER
ENV OTB_VERSION="7.0.0" \
TBX_VERSION="7" \
TBX_SUBVERSION="0"
ENV TBX="esa-snap_sentinel_unix_${TBX_VERSION}_${TBX_SUBVERSION}.sh" \
SNAP_URL="http://step.esa.int/downloads/${TBX_VERSION}.${TBX_SUBVERSION}/installers" \
OTB=OTB-${OTB_VERSION}-Linux64.run \
HOME=$HOME \
PATH=$PATH:$HOME/programs/snap/bin:$HOME/programs/OTB-${OTB_VERSION}-Linux64/bin
RUN sed -i -e 's:(groups):(groups 2>/dev/null):' /etc/bash.bashrc
# install gdal as root
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq libgdal-dev \
python3-gdal \
libspatialindex-dev \
libgfortran3 && \
rm -rf /var/lib/apt/lists/* && \
alias python=python3
# Grant access to folders for user
RUN fix-permissions $HOME && \
mkdir $HOME/programs && \
fix-permissions $HOME/programs
# copy the snap installation config file into the container
COPY snap7.varfile $HOME/programs/
# Download and install SNAP and ORFEO Toolbox
RUN cd $HOME/programs && \
wget $SNAP_URL/$TBX && \
chmod +x $TBX && \
./$TBX -q -varfile snap7.varfile && \
rm $TBX && \
rm snap7.varfile && \
cd $HOME/programs && \
wget https://www.orfeo-toolbox.org/packages/${OTB} && \
chmod +x $OTB && \
./${OTB} && \
rm -f OTB-${OTB_VERSION}-Linux64.run
USER $NB_UID
RUN conda install --quiet --yes \
oauthlib \
gdal \
fiona \
rasterio \
shapely \
xarray \
zarr \
psycopg2 \
geopandas \
cartopy \
tqdm \
lightgbm \
descartes && \
conda clean --all -f -y && \
fix-permissions $CONDA_DIR
# jupyter geojson as regular user
RUN jupyter labextension install @jupyterlab/geojson-extension
# get OST and tutorials
RUN cd $HOME && \
git clone https://github.com/Scartography/OpenSarToolkit.git && \
cd $HOME/OpenSarToolkit && \
pip install setuptools && \
pip install -r requirements.txt && \
pip install -r requirements_test.txt && \
python setup.py install && \
cd $HOME && \
git clone https://github.com/Scartography/OST_Notebooks.git
# Return Home
RUN cd $HOME