-
Notifications
You must be signed in to change notification settings - Fork 241
/
Dockerfile
76 lines (61 loc) · 2.37 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
# use debian as base image
FROM debian:stretch
# Label image
LABEL \
"Description"="Container for open source time series InSAR processing with Mintpy" \
"Github Source"="https://github.com/insarlab/MintPy/" \
"Installation"="https://github.com/insarlab/MintPy/blob/master/docs/installation.md" \
"Dockerfile Author"="Andre Theron" \
"Email"="andretheronsa@gmail.com"
# Install useful programs
RUN apt-get update && \
apt-get install -y \
git \
python3 \
python3-pip \
wget \
vim \
zip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Change default shell from dash to bash permanently
RUN ln -sf bash /bin/sh
# Prepare build time environment for conda and mintpy
ARG MINTPY_HOME=/home/python/MintPy
ARG PYTHON3DIR=/home/python/miniconda3
ARG PYAPS_HOME=/home/python/PyAPS
ARG WORK_DIR=/home/work/
# Prepare container environment
ENV MINTPY_HOME=${MINTPY_HOME}
ENV PYTHON3DIR=${PYTHON3DIR}
ENV PYAPS_HOME=${PYAPS_HOME}
ENV PATH=${MINTPY_HOME}/mintpy:${MINTPY_HOME}/sh:${PYTHON3DIR}/bin:${PATH}
ENV PYTHONPATH=${PYTHONPATH}:${MINTPY_HOME}:${PYAPS_HOME}
ENV PROJ_LIB=${PYTHON3DIR}/share/proj
# Set workdir
WORKDIR /home/python
# Pull and config mintpy
RUN git clone https://github.com/insarlab/MintPy.git
# Pull and config PyAPS
RUN git clone https://github.com/yunjunz/pyaps3.git PyAPS
# Install miniconda
RUN wget https://repo.continuum.io/miniconda/Miniconda3-4.5.4-Linux-x86_64.sh && \
chmod +x ./Miniconda3-4.5.4-Linux-x86_64.sh && \
./Miniconda3-4.5.4-Linux-x86_64.sh -b -p ${PYTHON3DIR} && \
rm ./Miniconda3-4.5.4-Linux-x86_64.sh
# Install dependencies
RUN ${PYTHON3DIR}/bin/conda config --add channels conda-forge && \
${PYTHON3DIR}/bin/conda install --yes --file ${MINTPY_HOME}/docs/requirements.txt
# Install pykml
RUN ${PYTHON3DIR}/bin/pip install git+https://github.com/yunjunz/pykml.git
# Install DASK - not tested yet
#RUN mkdir -p /home/.config/dask && \
# cp ${MINTPY_HOME}/mintpy/defaults/dask_mintpy.yaml /home/.config/dask/dask_mintpy.yaml
# Set working directory ENV - map a host data volume to this using "docker build . -t mintpy && docker run mintpy -v /host/path/to/data:/home/work/"
RUN mkdir -p ${WORK_DIR}
ENV WORK_DIR=${WORK_DIR}
WORKDIR ${WORK_DIR}
# Copy custom app scripts to app folder - not required
COPY ["./", "/home/app/"]
# Run entrypoint script - not required
CMD ["python3", "/home/app/app.py"]