This repository was archived by the owner on Oct 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
41 lines (31 loc) · 1.55 KB
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
# Build: docker build -t pyrate .
FROM osgeo/gdal:ubuntu-small-3.4.3
SHELL ["/bin/bash", "-c"]
# update system and install pthon tooling + thirdparty deps
RUN apt-get update
RUN apt-get install -y python3-pip python3-venv python3-wheel python3-dev
RUN apt-get install -y openmpi-bin libopenmpi-dev sqlite3
# update setuptools
RUN pip3 install --upgrade setuptools
# Copy PyRate source into image
COPY . /usr/src/PyRate
WORKDIR /usr/src/PyRate
# This is a hack the CI scripst also use, unit tests see, to assume it's read-only?
RUN chmod 444 tests/test_data/small_test/tif/geo_070709-070813_unw.tif
# Create virtual env & install PyRate into it...
RUN python3 -m venv /usr/local/PyRate
# Dance around numpy/GDAL installation ordering requirements first...
RUN source /usr/local/PyRate/bin/activate && pip3 install $(grep numpy requirements.txt)
RUN source /usr/local/PyRate/bin/activate && pip3 install GDAL==$(gdal-config --version)
# Then install our requirements verbatim
RUN source /usr/local/PyRate/bin/activate && pip3 install -r requirements.txt
RUN source /usr/local/PyRate/bin/activate && pip3 install -r requirements-test.txt
RUN source /usr/local/PyRate/bin/activate && pip3 install -r requirements-dev.txt
# For running like a program
RUN python3 setup.py install --prefix=/usr/local/PyRate
ENTRYPOINT [ "/bin/bash", "--init-file", "/usr/local/PyRate/bin/activate", "-i", "-c" ]
# For unit testing
ENV PYTHONPATH "/usr/src/PyRate:${PYTHONPATH}"
ENV OMPI_ALLOW_RUN_AS_ROOT 1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM 1
CMD [ "pytest", "-m", "'not slow and not mpi'" ]