-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_testing
95 lines (83 loc) · 3.05 KB
/
Dockerfile_testing
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
FROM ubuntu:20.04
LABEL maintainer="Chris Schnaufer <[email protected]>"
ENV DEBIAN_FRONTEND=noninteractive
# Add user
RUN useradd -u 49044 extractor \
&& mkdir /home/extractor
RUN chown -R extractor /home/extractor \
&& chgrp -R extractor /home/extractor
# Install the Python version we want
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
python3.8 \
python3-pip \
pdal && \
ln -sfn /usr/bin/python3.8 /usr/bin/python && \
ln -sfn /usr/bin/python3.8 /usr/bin/python3 && \
ln -sfn /usr/bin/python3.8m /usr/bin/python3m && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Perform some upgrades
RUN python3 -m pip install --upgrade --no-cache-dir pip
RUN python3 -m pip install --upgrade --no-cache-dir setuptools
# Install applications we need
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-gdal \
gdal-bin \
libgdal-dev \
gcc \
g++ \
python3.8-dev && \
python3 -m pip install --upgrade --no-cache-dir \
wheel && \
python3 -m pip install --upgrade --no-cache-dir \
numpy && \
python3 -m pip install --upgrade --no-cache-dir \
pygdal==3.0.4.* && \
python3 -m pip install --upgrade --no-cache-dir \
pylint && \
python3 -m pip install --upgrade --no-cache-dir \
pdal==2.3.6 && \
apt-get remove -y \
libgdal-dev \
gcc \
g++ \
python3-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt packages.txt /home/extractor/
USER root
RUN [ -s /home/extractor/packages.txt ] && \
(echo 'Installing packages' && \
apt-get update && \
cat /home/extractor/packages.txt | xargs apt-get install -y --no-install-recommends && \
rm /home/extractor/packages.txt && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*) || \
(echo 'No packages to install' && \
rm /home/extractor/packages.txt)
RUN [ -s /home/extractor/requirements.txt ] && \
(echo "Install python modules" && \
python -m pip install -U --no-cache-dir pip && \
python -m pip install --no-cache-dir setuptools && \
python -m pip install --no-cache-dir -r /home/extractor/requirements.txt && \
rm /home/extractor/requirements.txt) || \
(echo "No python modules to install" && \
rm /home/extractor/requirements.txt)
# Install the library
COPY agpypeline /home/extractor/agpypeline/agpypeline
COPY setup.py README.md /home/extractor/agpypeline/
COPY tests /home/extractor/agpypeline/tests
COPY data /home/extractor/agpypeline/data
COPY images /home/extractor/agpypeline/images
COPY integration_tests /home/extractor/agpypeline/integration_tests
RUN python3 -m pip install --upgrade /home/extractor/agpypeline
USER root
RUN chmod -R 777 /home/extractor/agpypeline
USER extractor
ENTRYPOINT ["/home/extractor/agpypeline/integration_tests/basic_algorithm.py"]