Skip to content

Instantly share code, notes, and snippets.

@sberryman
Created March 15, 2018 14:30
Show Gist options
  • Save sberryman/da36a65458969e2e0ef420559d035ea5 to your computer and use it in GitHub Desktop.
Save sberryman/da36a65458969e2e0ef420559d035ea5 to your computer and use it in GitHub Desktop.
[WIP] ODM Dockerfile
FROM phusion/baseimage
# Env variables
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies & required requisites
RUN add-apt-repository -y ppa:ubuntugis/ppa && \
add-apt-repository -y ppa:george-edison55/cmake-3.x && \
apt-get update -y && \
apt-get install software-properties-common -y && \
apt-get install --no-install-recommends -y \
git \
python-pip \
python-software-properties \
libgdal-dev \
gdal-bin \
libgeotiff-dev \
libgtk2.0-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libflann-dev \
libproj-dev \
libxext-dev \
liblapack-dev \
libeigen3-dev \
libvtk6-dev \
libgoogle-glog-dev \
libsuitesparse-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-regex-dev \
libboost-python-dev \
libboost-date-time-dev \
libboost-thread-dev \
python-dev \
python-networkx \
python-empy \
python-nose \
python-pyside \
python-pyexiv2 \
python-wheel \
libexiv2-dev \
liblas-bin \
libatlas-base-dev \
swig2.0 \
libboost-log-dev \
libjsoncpp-dev \
python-gdal \
cmake \
build-essential && \
pip install --upgrade pip && \
pip install --no-cache-dir setuptools && \
pip install --no-cache-dir -U \
PyYAML \
exifread \
gpxpy \
xmltodict \
catkin-pkg \
appsettings \
https://github.com/OpenDroneMap/gippy/archive/v0.3.9.tar.gz \
loky \
scipy \
shapely \
numpy \
pyproj && \
apt-get remove -y --auto-remove git cmake build-essential && \
apt-get purge -y --auto-remove git cmake build-essential && \
apt-get clean && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
ENV PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/lib/python2.7/dist-packages:/code/SuperBuild/src/opensfm" \
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib"
# Prepare directories
# If the WORKDIR doesn’t exist, it will be created even if it’s not used in any
# subsequent Dockerfile instruction.
# https://docs.docker.com/engine/reference/builder/#workdir
WORKDIR /code
# Copy repository files
# maybe change the code organization around would squeeze all these copies
# to a single copy?
COPY ccd_defs_check.py /code/ccd_defs_check.py
COPY CMakeLists.txt /code/CMakeLists.txt
COPY configure.sh /code/configure.sh
COPY /modules/ /code/modules/
COPY /opendm/ /code/opendm/
COPY /patched_files/ /code/patched_files/
COPY run.py /code/run.py
COPY run.sh /code/run.sh
COPY /scripts/ /code/scripts/
COPY /SuperBuild/cmake/ /code/SuperBuild/cmake/
COPY /SuperBuild/CMakeLists.txt /code/SuperBuild/CMakeLists.txt
COPY docker.settings.yaml /code/settings.yaml
COPY VERSION /code/VERSION
# Compile code in SuperBuild and root directories
RUN apt-get update && \
apt-get install --no-install-recommends -y \
git cmake build-essential && \
mkdir /code/SuperBuild/build && \
cd /code/SuperBuild/build && \
cmake .. && \
make -j$(nproc) && \
mkdir /code/build && \
cd /code/build && \
cmake .. && \
make -j$(nproc) && \
apt-get remove -y --auto-remove git cmake build-essential && \
apt-get purge -y --auto-remove git cmake build-essential && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* && \
rm -rf /code/SuperBuild/download \
/code/SuperBuild/src/vtk7 \
/code/SuperBuild/src/opencv \
/code/SuperBuild/src/pcl \
/code/SuperBuild/src/pdal \
/code/SuperBuild/src/opengv \
/code/SuperBuild/src/mvstexturing \
/code/SuperBuild/src/ceres \
/code/SuperBuild/build/vtk7 \
/code/SuperBuild/build/opencv
# Entry point
ENTRYPOINT ["python", "/code/run.py", "code"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment