|
1 | | -FROM alpine:3 |
| 1 | +FROM ubuntu:22.04 |
2 | 2 |
|
3 | | -RUN apk update |
| 3 | +# Avoid prompts from apt |
| 4 | +ENV DEBIAN_FRONTEND=noninteractive |
4 | 5 |
|
5 | | -RUN apk add make cmake g++ git proj-dev eigen-dev boost-dev libgeotiff-dev gtest-dev && \ |
6 | | - cd /usr/share/cmake/Modules && \ |
7 | | - wget https://raw.githubusercontent.com/ufz/geotiff/master/cmake/FindGeoTIFF.cmake |
| 6 | +# Set LC_ALL and unset LANGUAGE |
| 7 | +ENV LC_ALL=C |
| 8 | +ENV LANGUAGE= |
8 | 9 |
|
9 | | -RUN cd /home && \ |
10 | | - git clone https://github.com/ethz-asl/libnabo.git && \ |
11 | | - cd libnabo && \ |
12 | | - git checkout tags/1.0.7 && \ |
13 | | - mkdir build && cd build && \ |
14 | | - cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \ |
15 | | - make -j$(nproc) && make install |
| 10 | +# Update, install dependencies and cleanup |
| 11 | +RUN apt-get update && apt-get upgrade -y && \ |
| 12 | + apt-get install -y \ |
| 13 | + git \ |
| 14 | + build-essential \ |
| 15 | + cmake \ |
| 16 | + clang-tidy \ |
| 17 | + libeigen3-dev \ |
| 18 | + libproj-dev \ |
| 19 | + libgeotiff-dev \ |
| 20 | + libboost-all-dev && \ |
| 21 | + rm -rf /var/lib/apt/lists/* |
| 22 | + |
| 23 | +# Create a directory for building packages |
| 24 | +RUN mkdir -p /build && \ |
| 25 | + cd /build |
16 | 26 |
|
17 | | -RUN cd /home && \ |
18 | | - git clone https://github.com/LASzip/LASzip.git && \ |
| 27 | +# Clone, build and clean up LASzip |
| 28 | +RUN git clone https://github.com/LASzip/LASzip.git && \ |
19 | 29 | cd LASzip && \ |
20 | 30 | git checkout tags/2.0.1 && \ |
21 | | - mkdir build && cd build && \ |
| 31 | + mkdir build && cd build && \ |
22 | 32 | cmake .. && \ |
23 | | - make -j$(nproc) && make install |
| 33 | + make -j$(nproc) && \ |
| 34 | + make install && \ |
| 35 | + cp bin/Release/liblas* /usr/lib/ && \ |
| 36 | + cd ../.. && rm -rf LASzip |
24 | 37 |
|
25 | | -RUN cd /home && \ |
26 | | - git clone https://github.com/libLAS/libLAS.git && \ |
27 | | - cd libLAS && \ |
| 38 | +# Clone, build and clean up libLAS |
| 39 | +RUN git clone https://github.com/libLAS/libLAS.git && \ |
| 40 | + cd libLAS && \ |
28 | 41 | mkdir build && cd build && \ |
29 | 42 | cmake .. -DWITH_LASZIP=ON -DWITH_GEOTIFF=OFF -DCMAKE_CXX_STANDARD=11 && \ |
30 | | - make -j$(nproc) && make install |
| 43 | + make -j$(nproc) && \ |
| 44 | + make install && \ |
| 45 | + cd ../.. && rm -rf libLAS |
31 | 46 |
|
32 | | -RUN cd /home && \ |
33 | | - git clone http://github.com/qhull/qhull.git && \ |
| 47 | +# Clone, build and clean up Qhull |
| 48 | +RUN git clone https://github.com/qhull/qhull.git && \ |
34 | 49 | cd qhull && \ |
35 | 50 | git checkout tags/v7.3.2 && \ |
36 | | - mkdir -p build && cd build && \ |
| 51 | + cd build && \ |
37 | 52 | cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true && \ |
38 | | - make -j$(nproc) && make install |
| 53 | + make -j$(nproc) && \ |
| 54 | + make install && \ |
| 55 | + cd ../.. && rm -rf qhull |
39 | 56 |
|
40 | | -RUN cd /home && \ |
41 | | - git clone https://github.com/csiro-robotics/raycloudtools.git && \ |
42 | | - cd raycloudtools && \ |
| 57 | +# Clone, build and clean up libnabo |
| 58 | +RUN git clone https://github.com/ethz-asl/libnabo.git && \ |
| 59 | + cd libnabo && \ |
| 60 | + git checkout tags/1.0.7 && \ |
43 | 61 | mkdir build && cd build && \ |
44 | | - cmake .. -DGEOTIFF_LIBRARIES=/usr/lib/libgeotiff.so -DWITH_QHULL=ON -DWITH_LAS=ON -DWITH_TIFF=ON -DRAYCLOUD_BUILD_TESTS=ON && \ |
45 | | - make -j$(nproc) && make install |
46 | | - |
47 | | -RUN cd /home && \ |
48 | | - git clone https://github.com/csiro-robotics/treetools.git && \ |
| 62 | + cmake .. -DCMAKE_BUILD_TYPE=Release && \ |
| 63 | + make -j$(nproc) && \ |
| 64 | + make install && \ |
| 65 | + cd ../.. && rm -rf libnabo |
| 66 | + |
| 67 | +# Clone, build and install raycloudtools |
| 68 | +RUN git clone https://github.com/tim-devereux/raycloudtools.git && \ |
| 69 | + cd raycloudtools && \ |
| 70 | + mkdir build && \ |
| 71 | + cd build && \ |
| 72 | + cmake .. \ |
| 73 | + -DGeoTIFF_INCLUDE_DIR=/usr/include/geotiff \ |
| 74 | + -DGeoTIFF_LIBRARY=/usr/lib/x86_64-linux-gnu/libgeotiff.so \ |
| 75 | + -DPROJ_INCLUDE_DIR=/usr/include/proj \ |
| 76 | + -DPROJ_LIBRARY=/usr/lib/x86_64-linux-gnu/libproj.so \ |
| 77 | + -DWITH_QHULL=ON \ |
| 78 | + -DWITH_LAS=ON \ |
| 79 | + -DDOUBLE_RAYS=ON \ |
| 80 | + -DWITH_TIFF=ON \ |
| 81 | + -DCMAKE_BUILD_TYPE=Release && \ |
| 82 | + make -j$(nproc) && \ |
| 83 | + make install && \ |
| 84 | + cd ../.. && \ |
| 85 | + rm -rf raycloudtools |
| 86 | + |
| 87 | +# Clone and build TreeTools |
| 88 | +RUN git clone https://github.com/tim-devereux/treetools.git && \ |
49 | 89 | cd treetools && \ |
50 | | - mkdir build && cd build && \ |
51 | | - cmake .. -DWITH_TIFF=ON && \ |
52 | | - make -j$(nproc) && make install |
| 90 | + mkdir -p build && \ |
| 91 | + cd build && \ |
| 92 | + cmake .. \ |
| 93 | + -DPROJ_INCLUDE_DIR=/usr/include/proj \ |
| 94 | + -DPROJ_LIBRARY=/usr/lib/x86_64-linux-gnu/libproj.so \ |
| 95 | + -DWITH_TIFF=ON \ |
| 96 | + -DCMAKE_BUILD_TYPE=Release && \ |
| 97 | + make -j$(nproc) && \ |
| 98 | + make install && \ |
| 99 | + cd ../.. && \ |
| 100 | + rm -rf treetools |
| 101 | + |
| 102 | +# Update ldconfig |
| 103 | +RUN ldconfig /usr/local/lib |
| 104 | + |
| 105 | +# Clean up build directory |
| 106 | +RUN rm -rf /build |
| 107 | + |
| 108 | +# Set the working directory |
| 109 | +WORKDIR /workspace |
53 | 110 |
|
54 | | -WORKDIR /data |
| 111 | +# Set the entrypoint |
| 112 | +ENTRYPOINT ["/bin/bash"] |
0 commit comments