-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.pdal
More file actions
109 lines (84 loc) · 4.02 KB
/
Dockerfile.pdal
File metadata and controls
109 lines (84 loc) · 4.02 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
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
## Note :
## This Dockerfile allows us to build a PDAL image with the custom fork and branch
## It's used when it's necessary to use a specific version of PDAL
## typicaly when some features are not available in the conda-forge channel
## the PDAL version is specified by variables GITHUB_SERVER_URL and GITHUB_REPOSITORY
## and the branch by GITHUB_SHA
##
# code from https://github.com/PDAL/PDAL/blob/master/scripts/docker/ubuntu/Dockerfile
FROM condaforge/mambaforge:latest AS mamba_pdal
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN conda create -n las_digital_models -y
ARG GITHUB_SHA
ARG GITHUB_REPOSITORY="PDAL/PDAL"
ARG GITHUB_SERVER_URL="https://github.com"
SHELL ["conda", "run", "-n", "las_digital_models", "/bin/bash", "-c"]
RUN mamba install -c conda-forge git compilers conda-pack cmake make ninja sysroot_linux-64=2.17 && \
mamba install --yes -c conda-forge pdal --only-deps
RUN mamba install numpy requests gdal cgal geopandas pytest pip pyproj hydra-core hydra-colorlog rasterio fiona parallel
RUN rm -rf /opt/conda/envs/las_digital_models/lib/libpdal*
RUN rm -rf /opt/conda/envs/las_digital_models/lib/libpdal_plugin*
RUN git clone "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" pdal && \
cd pdal ; \
git checkout ${GITHUB_SHA}
RUN mkdir -p pdal/build && \
cd pdal/build && \
CXXFLAGS="-Werror=strict-aliasing" LDFLAGS="-Wl,-rpath-link,$CONDA_PREFIX/lib" cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LIBRARY_PATH:FILEPATH="$CONDA_PREFIX/lib" \
-DCMAKE_INCLUDE_PATH:FILEPATH="$CONDA_PREFIX/include" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
-DBUILD_PLUGIN_CPD=OFF \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_PLUGIN_NITF=ON \
-DBUILD_PLUGIN_ICEBRIDGE=ON \
-DBUILD_PLUGIN_HDF=ON \
-DBUILD_PLUGIN_TILEDB=ON \
-DBUILD_PLUGIN_E57=ON \
-DBUILD_PGPOINTCLOUD_TESTS=OFF \
-DWITH_ZSTD=ON \
..
RUN cd pdal/build && \
ninja
RUN cd pdal/build && \
ctest -V
RUN cd pdal/build && \
ninja install
RUN git clone https://github.com/PDAL/python.git
RUN mamba install --yes -c conda-forge pybind11
RUN mkdir -p python/build && \
cd python/build && \
CXXFLAGS="-Werror=strict-aliasing" LDFLAGS="-Wl,-rpath-link,$CONDA_PREFIX/lib" cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_LIBRARY_PATH:FILEPATH="$CONDA_PREFIX/lib" \
-DCMAKE_INCLUDE_PATH:FILEPATH="$CONDA_PREFIX/include" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX/lib/python3.13/site-packages/" \
..
RUN cd python/build && ninja
RUN cd python/build && ctest -V
RUN cd python/build && ninja install
RUN git clone https://github.com/PDAL/python-plugins.git pdal-python && \
cd pdal-python && git checkout 1.6.5 && \
pip install -vv . --no-deps
# Add our environment
RUN pip install laspy[lazrs]
RUN pip install ign-pdal-tools
RUN pip install rasterstats
FROM debian:bullseye-slim
# install PDAL
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/pdal /opt/conda/envs/las_digital_models/bin/pdal
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/python /opt/conda/envs/las_digital_models/bin/python
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/lib/ /opt/conda/envs/las_digital_models/lib/
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/bin/ /opt/conda/envs/las_digital_models/bin/
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/share/gdal/ /opt/conda/envs/las_digital_models/share/gdal/
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/ssl /opt/conda/envs/las_digital_models/ssl
COPY --from=mamba_pdal /opt/conda/envs/las_digital_models/share/proj/proj.db /opt/conda/envs/las_digital_models/share/proj/proj.db
ENV PATH=$PATH:/opt/conda/envs/las_digital_models/bin/:/opt/conda/envs/las_digital_models/
ENV PROJ_LIB=/opt/conda/envs/las_digital_models/share/proj/
ENV GDAL_DATA=/opt/conda/envs/las_digital_models/share/gdal/
WORKDIR /las-digital-models
RUN mkdir tmp
COPY las_digital_models las_digital_models
COPY test test
COPY configs configs
COPY run.sh run.sh