-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
152 lines (136 loc) · 5 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
FROM ubuntu:22.04 as base
ENV DOCKER_IMAGE agdrone/drone-workflow:1.1
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /
# Install Python
RUN apt-get update -y \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt-get update -y \
&& apt-get install --no-install-recommends -y \
git \
python3.8 \
python3.8-distutils \
python3-pip \
&& rm -f /usr/bin/python3 && ln -s /usr/bin/python3.8 /usr/bin/python3 \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& python3.8 -m pip install -U pip \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#Install dependencies
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
software-properties-common \
wget \
python3-gdal \
gdal-bin \
libsm6 \
libxext6 \
libxrender1 \
libglib2.0-0 \
docker.io \
libgl1-mesa-dev \
pdal \
python3-pip \
pdal \
python3-venv \
python3.8-venv \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install global environment to be used by multiple virtual environments
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
libgdal-dev \
gcc \
g++ \
python3-dev \
python3.8-dev \
curl && \
python3.8 -m pip install --upgrade --no-cache-dir \
wheel && \
python3.8 -m pip install --upgrade --no-cache-dir \
influxdb matplotlib Pillow pip piexif python-dateutil pyyaml scipy utm numpy cryptography PDAL==2.3.6 && \
python3.8 -m pip install --upgrade --no-cache-dir \
pygdal==3.4.1.* && \
python3 -m pip install --upgrade --no-cache-dir \
agpypeline && \
python3.8 -m pip install --upgrade --no-cache-dir \
pytest && \
curl https://ccl.cse.nd.edu/software/files/cctools-7.1.12-source.tar.gz > cctools-source.tar.gz && \
tar -xzf cctools-source.tar.gz &&\
cd cctools-*-source && \
./configure --prefix /cctools && make install && \
cd / && rm -r cctools-*-source cctools-source.tar.gz && \
apt-get remove -y \
libgdal-dev \
gcc \
g++ \
python-dev \
python3-dev \
python3.8-dev \
curl && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Docker
RUN apt-get update -y && \
apt-get install -y --reinstall systemd && \
apt-get remove -y docker docker.io containerd runc && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /
FROM base as base_scif
RUN python3.8 -m pip install --upgrade --no-cache-dir scif \
&& python3.8 -m pip install --upgrade --no-cache-dir setuptools \
&& echo "Finished install of scif"
ENTRYPOINT ["scif"]
ENV CPLUS_INCLUDE_PATH /usr/include/gdal
ENV C_INCLUDE_PATH /usr/include/gdal
# Install the apps
FROM base_scif as odm_scif
COPY ./scif_app_recipes/opendronemap_v2.2.scif /opt/
RUN scif install /opt/opendronemap_v2.2.scif
FROM odm_scif as combined_scif
COPY ./scif_app_recipes/ndcctools_v7.1.2_ubuntu22.04.scif /opt/
COPY ./scif_app_recipes/soilmask_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/soilmask_v0.0.1_ubuntu22.04.scif
RUN scif install /opt/ndcctools_v7.1.2_ubuntu22.04.scif
COPY ./scif_app_recipes/soilmask_ratio_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/soilmask_ratio_v0.0.1_ubuntu22.04.scif
COPY ./scif_app_recipes/plotclip_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/plotclip_v0.0.1_ubuntu22.04.scif
COPY ./scif_app_recipes/canopycover_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/canopycover_v0.0.1_ubuntu22.04.scif
COPY ./scif_app_recipes/greenness_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/greenness_v0.0.1_ubuntu22.04.scif
COPY *.jx *.py *.sh jx-args.json /scif/apps/src/
COPY plantit-workflow.sh /opt/dev/plantit-workflow.sh
RUN chmod a+x /scif/apps/src/*.sh && \
chmod a+x /scif/apps/src/*.py && \
chmod a+x /opt/dev/plantit-workflow.sh
COPY ./scif_app_recipes/git_v0.0.1_ubuntu22.04.scif /opt/
RUN scif install /opt/git_v0.0.1_ubuntu22.04.scif
# Silence a git warning
RUN git config --global advice.detachedHead false
COPY . /home/extractor/drone-makeflow
RUN chmod a+x /home/extractor/drone-makeflow