-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (37 loc) · 1.55 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
FROM oraclelinux:9
LABEL author="OPERA ADT" \
description="RTC cal/val release R4" \
version="1.0.1-final"
RUN yum -y update &&\
yum -y install curl &&\
adduser rtc_user
RUN mkdir -p /home/rtc_user/OPERA/RTC
RUN chmod -R 755 /home/rtc_user &&\
chown -R rtc_user:rtc_user /home/rtc_user/OPERA
USER rtc_user
ENV CONDA_PREFIX=/home/rtc_user/miniconda3
# install Miniconda
WORKDIR /home/rtc_user
RUN curl -sSL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh &&\
bash miniconda.sh -b -p ${CONDA_PREFIX} &&\
rm $HOME/miniconda.sh
ENV PATH=${CONDA_PREFIX}/bin:${PATH}
RUN ${CONDA_PREFIX}/bin/conda init bash
# copy RTC source code and set rtc_user as owner
COPY --chown=rtc_user:rtc_user . /home/rtc_user/OPERA/RTC
# create CONDA environment
RUN conda create --name "RTC" --file /home/rtc_user/OPERA/RTC/Docker/lockfile.lock && conda clean -afy
SHELL ["conda", "run", "-n", "RTC", "/bin/bash", "-c"]
WORKDIR /home/rtc_user/OPERA
# installing OPERA s1-reader
RUN curl -sSL https://github.com/isce-framework/s1-reader/archive/refs/tags/v0.2.2.tar.gz -o s1_reader_src.tar.gz &&\
tar -xvf s1_reader_src.tar.gz &&\
ln -s s1-reader-0.2.2 s1-reader &&\
rm s1_reader_src.tar.gz &&\
python -m pip install ./s1-reader
# installing OPERA RTC
RUN python -m pip install ./RTC &&\
echo "conda activate RTC" >> /home/rtc_user/.bashrc
COPY --chown=rtc_user --chmod=og-rw credentials/.netrc /home/rtc_user/.netrc
WORKDIR /home/rtc_user/scratch
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "RTC"]