Commit f3015cfe authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

WIP: developing dockerfile.

No related merge requests found
Showing with 143 additions and 0 deletions
+143 -0
-DUSE_SYSTEM_BOOST=OFF
-DUSE_SYSTEM_CURL=OFF
-DUSE_SYSTEM_EXPAT=OFF
-DUSE_SYSTEM_FFTW=OFF
-DUSE_SYSTEM_FREETYPE=OFF
-DUSE_SYSTEM_GDAL=OFF
-DUSE_SYSTEM_GEOS=OFF
-DUSE_SYSTEM_GEOTIFF=OFF
-DUSE_SYSTEM_GSL=OFF
-DUSE_SYSTEM_ITK=OFF
-DUSE_SYSTEM_LIBKML=OFF
-DUSE_SYSTEM_LIBSVM=OFF
-DUSE_SYSTEM_MUPARSER=OFF
-DUSE_SYSTEM_MUPARSERX=OFF
-DUSE_SYSTEM_OPENCV=OFF
-DUSE_SYSTEM_PNG=OFF
-DUSE_SYSTEM_SHARK=OFF
-DUSE_SYSTEM_TINYXML=OFF
-DUSE_SYSTEM_ZLIB=OFF
-DOTB_USE_6S=ON
-DOTB_USE_CURL=ON
-DOTB_USE_GLEW=OFF
-DOTB_USE_GLFW=OFF
-DOTB_USE_GLUT=OFF
-DOTB_USE_GSL=ON
-DOTB_USE_LIBKML=OFF
-DOTB_USE_LIBSVM=ON
-DOTB_USE_MPI=ON
-DOTB_USE_MUPARSER=ON
-DOTB_USE_MUPARSERX=ON
-DOTB_USE_OPENCV=ON
-DOTB_USE_OPENGL=OFF
-DOTB_USE_QT=OFF
-DOTB_USE_QWT=OFF
-DOTB_USE_SHARK=ON
-DOTB_USE_SIFTFAST=ON
-DOTB_USE_SPTW=ON
-DOTB_DATA_ROOT=/home/raffaele/otb-root/otb/Data
-DOTB_USE_OPENMP=ON
-DOTB_USE_SSE_FLAGS=ON
\ No newline at end of file
ARG BASE_IMG=ubuntu:20.04
# Base image can be either focal (20.04) or bionic (18.04) and descendants
FROM $BASE_IMG
LABEL description="A base image with OTB and remote modules for the MORINGAv2 platform, CIRAD/UMR TETIS"
WORKDIR /tmp
ARG DEPS_INSTALL_PREFIX=/opt/otb
# Install build dependencies
RUN apt-get update \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends \
bzip2 \
cmake \
curl \
file \
g++ \
gcc \
git \
make \
nano \
patch \
pkg-config \
python3-dev \
python3-numpy \
python3-pip \
python3-setuptools \
python3-sklearn \
python3-wheel \
swig \
unzip \
vim \
wget \
zip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# OTB branch to clone
ARG OTB_BRANCH=release-8.1
# Set USE_SYSTEM_* flags
COPY docker/build-flags-otb.txt .
# SuperBuild OTB
RUN mkdir /tmp/SuperBuild-archives /tmp/build /opt/otb \
&& git clone --single-branch -b $OTB_BRANCH "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git" \
&& cd SuperBuild-archives \
&& OTB_VERSION=$(head -n1 /tmp/otb/RELEASE_NOTES.txt | sed -r 's/OTB-v ([0-9].[0-9]).[0-9] -.*/\1/') \
&& curl -s "https://www.orfeo-toolbox.org/packages/archives/OTB/SuperBuild-archives-$OTB_VERSION.tar.bz2" \
| tar -xjv --exclude 'q*' --exclude '*gl*'
RUN cd /tmp/build \
&& OTB_CMAKE_FLAGS=$(cat "../build-flags-otb.txt") \
&& cmake /tmp/otb/SuperBuild \
$OTB_CMAKE_FLAGS \
-DCMAKE_BUILD_TYPE="Release" \
-DDOWNLOAD_LOCATION=/tmp/SuperBuild-archives \
-DCMAKE_INSTALL_PREFIX=/opt/otb \
&& make OTB_DEPENDS -j12
RUN cd /tmp/otb/Modules/Remote \
&& rm -f otbGRM.remote.cmake \
&& git clone "https://gitlab.irstea.fr/remi.cresson/GRM.git" \
&& git clone -b disassembled "https://gitlab.irstea.fr/remi.cresson/LSGRM.git" \
&& git clone "https://gitlab.irstea.fr/raffaele.gaetano/otbVectorClassification.git" \
&& git clone "https://gitlab.irstea.fr/raffaele.gaetano/otbSelectiveHaralickTextures.git" \
&& git clone "https://gitlab.irstea.fr/remi.cresson/TimeSeriesUtils.git" \
&& git clone "https://gitlab.irstea.fr/remi.cresson/TemporalSmoothing.git" \
&& git clone -b no_gapfilling "https://gitlab.irstea.fr/remi.cresson/NDVITimeSeries.git" \
&& git clone -b all_in_one_app "https://framagit.org/iota2-project/otbPointMatchCoregistrationModel.git" \
&& git clone "https://gitlab.orfeo-toolbox.org/remote_modules/otb-slic.git" \
&& cd /tmp/build/OTB/build \
&& cmake /tmp/otb \
-DModule_otbGRM=ON \
-DModule_LSGRM=ON \
-DModule_OTBAppSelectiveHaralickTextures=ON \
-DModule_OTBAppVectorFeaturesStatistics=ON \
-DModule_OTBTemporalGapFilling=ON \
-DModule_S1TilingSupportApplications=ON \
-DModule_NDVITimeSeries=ON \
-DModule_OTBPhenology=ON \
-DModule_TemporalSmoothing=ON \
-DModule_TimeSeriesUtils=ON \
-DModule_OTBAppPointMatchCoregistration=ON \
-DModule_OTBSLIC=ON \
-DModule_DiapOTBModule=OFF \
-DModule_OTBBioVars=OFF \
-DModule_OTBFFSforGMM=OFF \
-DModule_SertitObject=OFF \
-DOTB_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DCMAKE_INSTALL_PREFIX=/opt/otb \
&& cd /tmp/build \
&& make -j12 \
&& rm -rf /tmp/* /root/.cache /opt/otb/bin/otbgui_*
# Persistent environment variables
ENV PATH="/opt/otb/bin:$PATH"
ENV PYTHONPATH="/opt/otb/lib/python3/dist-packages:/opt/otb/lib/otb/python:$PYTHONPATH"
ENV LD_LIBRARY_PATH="/opt/otb/lib:$LD_LIBRARY_PATH"
ENV OTB_APPLICATION_PATH="/opt/otb/lib/otb/applications"
ENV PROJ_LIB="$DEPS_INSTALL_PREFIX/share/proj"
ENV GDAL_DATA="$DEPS_INSTALL_PREFIX/share/gdal"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment