improve and modernize the Dockerfiles

release/4.3a0
Varun Agrawal 2020-06-02 16:33:57 -05:00
parent d0bd3d8715
commit 92634d1525
4 changed files with 25 additions and 15 deletions

View File

@ -1,11 +1,16 @@
# Basic Ubuntu 18.04 image with Boost and TBB installed. To be used for building further downstream packages.
# Get the base Ubuntu image from Docker Hub
FROM ubuntu:bionic
# Disable GUI prompts
ENV DEBIAN_FRONTEND noninteractive
# Update apps on the base image
RUN apt-get -y update && apt install -y
RUN apt-get -y update && apt-get -y install
# Install C++
RUN apt-get -y install build-essential
RUN apt-get -y install build-essential apt-utils
# Install boost and cmake
RUN apt-get -y install libboost-all-dev cmake

View File

@ -1,16 +1,18 @@
# This GTSAM image connects to the host X-server via VNC to provide a Graphical User Interface for interaction.
# Get the base Ubuntu/GTSAM image from Docker Hub
FROM dellaert/ubuntu-gtsam-python:bionic
# Things needed to get a python GUI
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get install -y python-tk
RUN apt install -y python-tk
RUN pip install matplotlib
# Install a VNC X-server, Frame buffer, and windows manager
RUN apt-get install -y x11vnc xvfb fluxbox
RUN apt install -y x11vnc xvfb fluxbox
# Finally, install wmctrl needed for bootstrap script
RUN apt-get install -y wmctrl
RUN apt install -y wmctrl
# Copy bootstrap script and make sure it runs
COPY bootstrap.sh /

View File

@ -1,29 +1,31 @@
# GTSAM Ubuntu image with Python wrapper support.
# Get the base Ubuntu/GTSAM image from Docker Hub
FROM dellaert/ubuntu-gtsam:bionic
FROM dellaert/ubuntu-gtsam:latest
# Install pip
RUN apt-get install -y python-pip python-dev
RUN apt-get install -y python3-pip python3-dev
# Install python wrapper requirements
RUN pip install -r /usr/src/gtsam/cython/requirements.txt
RUN pip3 install -U -r /usr/src/gtsam/cython/requirements.txt
# Run cmake again, now with cython toolbox on
WORKDIR /usr/src/gtsam/build
RUN cmake \
-DCMAKE_BUILD_TYPE=Release \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_WITH_EIGEN_MKL=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_TIMING_ALWAYS=OFF \
-DGTSAM_BUILD_TESTS=OFF \
-DGTSAM_INSTALL_CYTHON_TOOLBOX=ON \
-DGTSAM_PYTHON_VERSION=3\
..
# Build again, as ubuntu-gtsam image cleaned
RUN make -j3 install && make clean
# Needed to run python wrapper:
RUN echo 'export PYTHONPATH=/usr/local/cython/' >> /root/.bashrc
RUN echo 'export PYTHONPATH=/usr/local/cython/:$PYTHONPATH' >> /root/.bashrc
# Run bash
CMD ["bash"]

View File

@ -1,5 +1,7 @@
# Ubuntu image with GTSAM installed. Configured with Boost and TBB support.
# Get the base Ubuntu image from Docker Hub
FROM dellaert/ubuntu-boost-tbb-eigen3:bionic
FROM dellaert/ubuntu-boost-tbb:latest
# Install git
RUN apt-get update && \
@ -11,13 +13,12 @@ RUN apt-get install -y build-essential
# Clone GTSAM
WORKDIR /usr/src/
RUN git clone https://bitbucket.org/gtborg/gtsam.git
RUN mkdir build
# Run cmake
RUN mkdir /usr/src/gtsam/build
WORKDIR /usr/src/gtsam/build
RUN cmake \
-DCMAKE_BUILD_TYPE=Release \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_WITH_EIGEN_MKL=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_TIMING_ALWAYS=OFF \
@ -26,10 +27,10 @@ RUN cmake \
..
# Build
RUN make -j3 install && make clean
RUN make -j4 install && make clean
# Needed to link with GTSAM
RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> /root/.bashrc
RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib:LD_LIBRARY_PATH' >> /root/.bashrc
# Run bash
CMD ["bash"]