Skip to content

Instantly share code, notes, and snippets.

@MargrietGroenendijk
Last active May 5, 2024 19:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MargrietGroenendijk/b227b08a8a346beec774a953d2afa347 to your computer and use it in GitHub Desktop.
Save MargrietGroenendijk/b227b08a8a346beec774a953d2afa347 to your computer and use it in GitHub Desktop.
TileDB and geospatial packages
FROM ubuntu:22.04
###############################################################################
# Setup home environment
###############################################################################
RUN useradd tiledb \
&& mkdir /home/tiledb \
&& chown tiledb /home/tiledb
ENV HOME /home/tiledb
WORKDIR /home/tiledb
###############################################################################
# Install dependencies
##############################################################################
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
apache2 \
apache2-dev \
build-essential \
ca-certificates \
cmake \
g++ \
gcc \
gettext \
git \
libapache2-mod-fcgid \
libcairo2-dev \
libcurl4-gnutls-dev \
libexempi-dev \
libfcgi-dev \
libfreetype6-dev \
libfribidi-dev \
libgeos-dev \
libgeotiff-dev \
libgif-dev \
libglib2.0-dev \
libharfbuzz-dev \
libjpeg-dev \
libpixman-1-dev \
libpng-dev \
libpq-dev \
libprotobuf-c-dev \
libprotobuf-c1 \
libprotobuf-dev \
librsvg2-dev \
libsqlite3-dev \
libssl-dev \
libssl-dev \
libxslt1-dev \
locales \
make \
ninja-build \
patch \
protobuf-c-compiler \
protobuf-compiler \
pybind11-dev \
python3 \
python3-dev \
python3-pip \
software-properties-common \
sqlite3 \
unzip \
wget \
xz-utils \
&& apt-get clean \
&& apt-get purge -y \
&& rm -rf /var/lib/apt/lists* \
&& pip3 install cmake
RUN update-locale LANG=C.UTF-8
###############################################################################
# Install TileDB.
###############################################################################
ARG enable
RUN git clone -b 2.17.1 --depth 1 https://github.com/TileDB-Inc/TileDB.git \
&& cd TileDB \
&& mkdir build \
&& cd build \
&& ../bootstrap \
--prefix=/usr/local \
--enable-verbose \
--enable-s3 \
--enable-serialization \
--enable-tools \
--enable=${enable} \
&& make -j$(nproc) \
&& make -j$(nproc) examples \
&& make install-tiledb \
&& ldconfig \
&& chown -R tiledb: /home/tiledb
###############################################################################
# Install Proj
###############################################################################
RUN git clone --branch 9.1.1 --depth=1 https://github.com/OSGeo/PROJ.git \
&& cd PROJ \
&& mkdir build \
&& cd build \
&& cmake .. -DCMAKE_BUILD_TYPE=Release \
&& make -j$(nproc) \
&& make install
###############################################################################
# Install GDAL
###############################################################################
RUN git clone --branch v3.7.1 --depth 1 https://github.com/OSGeo/gdal.git \
&& cd gdal \
&& mkdir build \
&& cd build \
&& cmake .. \
&& cmake --build . -j$(nproc) \
&& cmake --build . --target install
###############################################################################
# Install PDAL
###############################################################################
RUN git clone --branch 2.5.6 --depth=1 https://github.com/PDAL/PDAL.git \
&& cd PDAL \
&& mkdir -p build \
&& cd build \
&& cmake -G "Unix Makefiles" .. \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_PLUGIN_TILEDB=ON \
-DWITH_TESTS=OFF \
&& make -j$(nproc) \
&& make install
###############################################################################
# Install Python deps
###############################################################################
ENV PYTHONPATH "${PYTHONPATH}:/usr/local/lib/python3/dist-packages"
RUN su - tiledb -c "pip install rasterio pdal pyogrio tiledb 'fiona==1.8.22' \
folium scipy matplotlib pyarrow pyproj pandas geopandas ipywidgets jupyterlab==3.4.5 pystac pystac-client shapely \
--no-binary fiona --no-binary rasterio --no-binary pdal \
--no-binary pyogrio --no-binary tiledb"
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
RUN su - tiledb -c "pip install pybabylonjs opencv-python==4.7.0.72"
RUN su - tiledb -c "pip install tiledb-cloud"
RUN ldconfig
ENV PATH="${PATH}:/home/tiledb/.local/bin"
WORKDIR /home/tiledb/app
CMD ["/bin/bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment