From 4711ca8980eddd33299b6b0cc24650e4481942d0 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 28 Oct 2018 17:34:41 -0400 Subject: [PATCH 1/6] Added a number of docker images --- docker/ubuntu-gtsam-python-vnc/Dockerfile | 18 ++++ docker/ubuntu-gtsam-python-vnc/bootstrap.sh | 111 ++++++++++++++++++++ docker/ubuntu-gtsam-python-vnc/build.sh | 4 + docker/ubuntu-gtsam-python-vnc/vnc.sh | 5 + docker/ubuntu-gtsam-python/Dockerfile | 29 +++++ docker/ubuntu-gtsam-python/build.sh | 3 + docker/ubuntu-gtsam/Dockerfile | 35 ++++++ docker/ubuntu-gtsam/build.sh | 3 + 8 files changed, 208 insertions(+) create mode 100644 docker/ubuntu-gtsam-python-vnc/Dockerfile create mode 100755 docker/ubuntu-gtsam-python-vnc/bootstrap.sh create mode 100755 docker/ubuntu-gtsam-python-vnc/build.sh create mode 100755 docker/ubuntu-gtsam-python-vnc/vnc.sh create mode 100644 docker/ubuntu-gtsam-python/Dockerfile create mode 100755 docker/ubuntu-gtsam-python/build.sh create mode 100644 docker/ubuntu-gtsam/Dockerfile create mode 100755 docker/ubuntu-gtsam/build.sh diff --git a/docker/ubuntu-gtsam-python-vnc/Dockerfile b/docker/ubuntu-gtsam-python-vnc/Dockerfile new file mode 100644 index 000000000..83222881a --- /dev/null +++ b/docker/ubuntu-gtsam-python-vnc/Dockerfile @@ -0,0 +1,18 @@ +# 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 pip install matplotlib + +# Install a VNC X-server, Frame buffer, and windows manager +RUN apt-get install -y x11vnc xvfb fluxbox + +# Finally, install wmctrl needed for bootstrap script +RUN apt-get install -y wmctrl + +# Copy bootstrap script and make sure it runs +COPY bootstrap.sh / + +CMD '/bootstrap.sh' diff --git a/docker/ubuntu-gtsam-python-vnc/bootstrap.sh b/docker/ubuntu-gtsam-python-vnc/bootstrap.sh new file mode 100755 index 000000000..21356138f --- /dev/null +++ b/docker/ubuntu-gtsam-python-vnc/bootstrap.sh @@ -0,0 +1,111 @@ +#!/bin/bash + +# Based on: http://www.richud.com/wiki/Ubuntu_Fluxbox_GUI_with_x11vnc_and_Xvfb + +main() { + log_i "Starting xvfb virtual display..." + launch_xvfb + log_i "Starting window manager..." + launch_window_manager + log_i "Starting VNC server..." + run_vnc_server +} + +launch_xvfb() { + local xvfbLockFilePath="/tmp/.X1-lock" + if [ -f "${xvfbLockFilePath}" ] + then + log_i "Removing xvfb lock file '${xvfbLockFilePath}'..." + if ! rm -v "${xvfbLockFilePath}" + then + log_e "Failed to remove xvfb lock file" + exit 1 + fi + fi + + # Set defaults if the user did not specify envs. + export DISPLAY=${XVFB_DISPLAY:-:1} + local screen=${XVFB_SCREEN:-0} + local resolution=${XVFB_RESOLUTION:-1280x960x24} + local timeout=${XVFB_TIMEOUT:-5} + + # Start and wait for either Xvfb to be fully up or we hit the timeout. + Xvfb ${DISPLAY} -screen ${screen} ${resolution} & + local loopCount=0 + until xdpyinfo -display ${DISPLAY} > /dev/null 2>&1 + do + loopCount=$((loopCount+1)) + sleep 1 + if [ ${loopCount} -gt ${timeout} ] + then + log_e "xvfb failed to start" + exit 1 + fi + done +} + +launch_window_manager() { + local timeout=${XVFB_TIMEOUT:-5} + + # Start and wait for either fluxbox to be fully up or we hit the timeout. + fluxbox & + local loopCount=0 + until wmctrl -m > /dev/null 2>&1 + do + loopCount=$((loopCount+1)) + sleep 1 + if [ ${loopCount} -gt ${timeout} ] + then + log_e "fluxbox failed to start" + exit 1 + fi + done +} + +run_vnc_server() { + local passwordArgument='-nopw' + + if [ -n "${VNC_SERVER_PASSWORD}" ] + then + local passwordFilePath="${HOME}/.x11vnc.pass" + if ! x11vnc -storepasswd "${VNC_SERVER_PASSWORD}" "${passwordFilePath}" + then + log_e "Failed to store x11vnc password" + exit 1 + fi + passwordArgument=-"-rfbauth ${passwordFilePath}" + log_i "The VNC server will ask for a password" + else + log_w "The VNC server will NOT ask for a password" + fi + + x11vnc -ncache 10 -ncache_cr -display ${DISPLAY} -forever ${passwordArgument} & + wait $! +} + +log_i() { + log "[INFO] ${@}" +} + +log_w() { + log "[WARN] ${@}" +} + +log_e() { + log "[ERROR] ${@}" +} + +log() { + echo "[$(date '+%Y-%m-%d %H:%M:%S')] ${@}" +} + +control_c() { + echo "" + exit +} + +trap control_c SIGINT SIGTERM SIGHUP + +main + +exit diff --git a/docker/ubuntu-gtsam-python-vnc/build.sh b/docker/ubuntu-gtsam-python-vnc/build.sh new file mode 100755 index 000000000..8d280252f --- /dev/null +++ b/docker/ubuntu-gtsam-python-vnc/build.sh @@ -0,0 +1,4 @@ +# Build command for Docker image +# TODO(dellaert): use docker compose and/or cmake +# Needs to be run in docker/ubuntu-gtsam-python-vnc directory +docker build -t dellaert/ubuntu-gtsam-python-vnc:bionic . diff --git a/docker/ubuntu-gtsam-python-vnc/vnc.sh b/docker/ubuntu-gtsam-python-vnc/vnc.sh new file mode 100755 index 000000000..c0ab692c6 --- /dev/null +++ b/docker/ubuntu-gtsam-python-vnc/vnc.sh @@ -0,0 +1,5 @@ +# After running this script, connect VNC client to 0.0.0.0:5900 +docker run -it \ + --workdir="/usr/src/gtsam" \ + -p 5900:5900 \ + dellaert/ubuntu-gtsam-python-vnc:bionic \ No newline at end of file diff --git a/docker/ubuntu-gtsam-python/Dockerfile b/docker/ubuntu-gtsam-python/Dockerfile new file mode 100644 index 000000000..0c7d131be --- /dev/null +++ b/docker/ubuntu-gtsam-python/Dockerfile @@ -0,0 +1,29 @@ +# Get the base Ubuntu/GTSAM image from Docker Hub +FROM dellaert/ubuntu-gtsam:bionic + +# Install pip +RUN apt-get install -y python-pip python-dev + +# Install python wrapper requirements +RUN pip install -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 \ + .. + +# 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 bash +CMD ["bash"] diff --git a/docker/ubuntu-gtsam-python/build.sh b/docker/ubuntu-gtsam-python/build.sh new file mode 100755 index 000000000..1696f6c61 --- /dev/null +++ b/docker/ubuntu-gtsam-python/build.sh @@ -0,0 +1,3 @@ +# Build command for Docker image +# TODO(dellaert): use docker compose and/or cmake +docker build --no-cache -t dellaert/ubuntu-gtsam-python:bionic . diff --git a/docker/ubuntu-gtsam/Dockerfile b/docker/ubuntu-gtsam/Dockerfile new file mode 100644 index 000000000..bdfa8d9a5 --- /dev/null +++ b/docker/ubuntu-gtsam/Dockerfile @@ -0,0 +1,35 @@ +# Get the base Ubuntu image from Docker Hub +FROM dellaert/ubuntu-boost-tbb-eigen3:bionic + +# Install git +RUN apt-get update && \ + apt-get install -y git + +# Install compiler +RUN apt-get install -y build-essential + +# Clone GTSAM +WORKDIR /usr/src/ +RUN git clone https://bitbucket.org/gtborg/gtsam.git + +# 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 \ + -DGTSAM_BUILD_TESTS=OFF \ + -DGTSAM_INSTALL_CYTHON_TOOLBOX=OFF \ + .. + +# Build +RUN make -j3 install && make clean + +# Needed to link with GTSAM +RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> /root/.bashrc + +# Run bash +CMD ["bash"] diff --git a/docker/ubuntu-gtsam/build.sh b/docker/ubuntu-gtsam/build.sh new file mode 100755 index 000000000..bf545e9c2 --- /dev/null +++ b/docker/ubuntu-gtsam/build.sh @@ -0,0 +1,3 @@ +# Build command for Docker image +# TODO(dellaert): use docker compose and/or cmake +docker build --no-cache -t dellaert/ubuntu-gtsam:bionic . From d0bd3d87154f411a66e2cd3ca2e537e46f47568e Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 2 Jun 2020 15:13:30 -0500 Subject: [PATCH 2/6] removed dependency on Eigen3 since we provide Eigen 3.3.7 and Ubuntu Bionic provides Eigen 3.3.4. --- .../Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) rename docker/{ubuntu-boost-tbb-eigen3 => ubuntu-boost-tbb}/Dockerfile (72%) diff --git a/docker/ubuntu-boost-tbb-eigen3/Dockerfile b/docker/ubuntu-boost-tbb/Dockerfile similarity index 72% rename from docker/ubuntu-boost-tbb-eigen3/Dockerfile rename to docker/ubuntu-boost-tbb/Dockerfile index 33aa1ab96..6dd9dfa62 100644 --- a/docker/ubuntu-boost-tbb-eigen3/Dockerfile +++ b/docker/ubuntu-boost-tbb/Dockerfile @@ -2,7 +2,7 @@ FROM ubuntu:bionic # Update apps on the base image -RUN apt-get -y update && apt-get install -y +RUN apt-get -y update && apt install -y # Install C++ RUN apt-get -y install build-essential @@ -12,7 +12,3 @@ RUN apt-get -y install libboost-all-dev cmake # Install TBB RUN apt-get -y install libtbb-dev - -# Install latest Eigen -RUN apt-get install -y libeigen3-dev - From 92634d152513f1acc8f878421fe17b7c9781b936 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 2 Jun 2020 16:33:57 -0500 Subject: [PATCH 3/6] improve and modernize the Dockerfiles --- docker/ubuntu-boost-tbb/Dockerfile | 9 +++++++-- docker/ubuntu-gtsam-python-vnc/Dockerfile | 8 +++++--- docker/ubuntu-gtsam-python/Dockerfile | 12 +++++++----- docker/ubuntu-gtsam/Dockerfile | 11 ++++++----- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/docker/ubuntu-boost-tbb/Dockerfile b/docker/ubuntu-boost-tbb/Dockerfile index 6dd9dfa62..9f6eea3b8 100644 --- a/docker/ubuntu-boost-tbb/Dockerfile +++ b/docker/ubuntu-boost-tbb/Dockerfile @@ -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 diff --git a/docker/ubuntu-gtsam-python-vnc/Dockerfile b/docker/ubuntu-gtsam-python-vnc/Dockerfile index 83222881a..8b6b97f46 100644 --- a/docker/ubuntu-gtsam-python-vnc/Dockerfile +++ b/docker/ubuntu-gtsam-python-vnc/Dockerfile @@ -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 / diff --git a/docker/ubuntu-gtsam-python/Dockerfile b/docker/ubuntu-gtsam-python/Dockerfile index 0c7d131be..a9a9782f4 100644 --- a/docker/ubuntu-gtsam-python/Dockerfile +++ b/docker/ubuntu-gtsam-python/Dockerfile @@ -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"] diff --git a/docker/ubuntu-gtsam/Dockerfile b/docker/ubuntu-gtsam/Dockerfile index bdfa8d9a5..c09d4b16a 100644 --- a/docker/ubuntu-gtsam/Dockerfile +++ b/docker/ubuntu-gtsam/Dockerfile @@ -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"] From 8b66960a42d30cb8dfb0e3a7be08e76f9fcfec30 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 2 Jun 2020 17:02:14 -0500 Subject: [PATCH 4/6] small logistical fixes --- docker/ubuntu-gtsam-python-vnc/Dockerfile | 2 +- docker/ubuntu-gtsam-python/Dockerfile | 4 ++-- docker/ubuntu-gtsam/Dockerfile | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker/ubuntu-gtsam-python-vnc/Dockerfile b/docker/ubuntu-gtsam-python-vnc/Dockerfile index 8b6b97f46..26f995c56 100644 --- a/docker/ubuntu-gtsam-python-vnc/Dockerfile +++ b/docker/ubuntu-gtsam-python-vnc/Dockerfile @@ -1,7 +1,7 @@ # 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 +FROM dellaert/ubuntu-gtsam-python:latest # Things needed to get a python GUI ENV DEBIAN_FRONTEND noninteractive diff --git a/docker/ubuntu-gtsam-python/Dockerfile b/docker/ubuntu-gtsam-python/Dockerfile index a9a9782f4..71787d480 100644 --- a/docker/ubuntu-gtsam-python/Dockerfile +++ b/docker/ubuntu-gtsam-python/Dockerfile @@ -7,7 +7,7 @@ FROM dellaert/ubuntu-gtsam:latest RUN apt-get install -y python3-pip python3-dev # Install python wrapper requirements -RUN pip3 install -U -r /usr/src/gtsam/cython/requirements.txt +RUN python3 -m pip install -U -r /usr/src/gtsam/cython/requirements.txt # Run cmake again, now with cython toolbox on WORKDIR /usr/src/gtsam/build @@ -22,7 +22,7 @@ RUN cmake \ .. # Build again, as ubuntu-gtsam image cleaned -RUN make -j3 install && make clean +RUN make -j4 install && make clean # Needed to run python wrapper: RUN echo 'export PYTHONPATH=/usr/local/cython/:$PYTHONPATH' >> /root/.bashrc diff --git a/docker/ubuntu-gtsam/Dockerfile b/docker/ubuntu-gtsam/Dockerfile index c09d4b16a..393443361 100644 --- a/docker/ubuntu-gtsam/Dockerfile +++ b/docker/ubuntu-gtsam/Dockerfile @@ -10,13 +10,13 @@ RUN apt-get update && \ # Install compiler RUN apt-get install -y build-essential -# Clone GTSAM +# Clone GTSAM (develop branch) WORKDIR /usr/src/ -RUN git clone https://bitbucket.org/gtborg/gtsam.git -RUN mkdir build +RUN git clone --single-branch --branch develop https://github.com/borglab/gtsam.git -# Run cmake +# Change to build directory. Will be created automatically. WORKDIR /usr/src/gtsam/build +# Run cmake RUN cmake \ -DCMAKE_BUILD_TYPE=Release \ -DGTSAM_WITH_EIGEN_MKL=OFF \ From 23db3bb721fc5603e7fb9363029b88e92ac480e6 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco Claraco Date: Tue, 14 Jul 2020 23:24:47 +0200 Subject: [PATCH 5/6] docker tag and pip3 fixes; add a readme --- docker/README.md | 16 ++++++++++++++++ docker/ubuntu-boost-tbb/build.sh | 3 +++ docker/ubuntu-gtsam-python-vnc/Dockerfile | 6 +++--- docker/ubuntu-gtsam-python/Dockerfile | 4 ++-- docker/ubuntu-gtsam/Dockerfile | 6 +++--- 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 docker/README.md create mode 100755 docker/ubuntu-boost-tbb/build.sh diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..4dec63b94 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,16 @@ +# Instructions + +Build all docker images, in order: + +```bash +(cd ubuntu-boost-tbb && exec build.sh) +(cd ubuntu-gtsam && exec build.sh) +(cd ubuntu-gtsam-python && exec build.sh) +(cd ubuntu-gtsam-python-vnc && exec build.sh) +``` + +Then launch with: + + docker run dellaert/ubuntu-gtsam-python-vnc:bionic + + diff --git a/docker/ubuntu-boost-tbb/build.sh b/docker/ubuntu-boost-tbb/build.sh new file mode 100755 index 000000000..2dac4c3db --- /dev/null +++ b/docker/ubuntu-boost-tbb/build.sh @@ -0,0 +1,3 @@ +# Build command for Docker image +# TODO(dellaert): use docker compose and/or cmake +docker build --no-cache -t dellaert/ubuntu-boost-tbb:bionic . diff --git a/docker/ubuntu-gtsam-python-vnc/Dockerfile b/docker/ubuntu-gtsam-python-vnc/Dockerfile index 26f995c56..61ecd9b9a 100644 --- a/docker/ubuntu-gtsam-python-vnc/Dockerfile +++ b/docker/ubuntu-gtsam-python-vnc/Dockerfile @@ -1,18 +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:latest +FROM dellaert/ubuntu-gtsam-python:bionic # Things needed to get a python GUI ENV DEBIAN_FRONTEND noninteractive RUN apt install -y python-tk -RUN pip install matplotlib +RUN python3 -m pip install matplotlib # Install a VNC X-server, Frame buffer, and windows manager RUN apt install -y x11vnc xvfb fluxbox # Finally, install wmctrl needed for bootstrap script -RUN apt install -y wmctrl +RUN apt install -y wmctrl # Copy bootstrap script and make sure it runs COPY bootstrap.sh / diff --git a/docker/ubuntu-gtsam-python/Dockerfile b/docker/ubuntu-gtsam-python/Dockerfile index 71787d480..c733ceb19 100644 --- a/docker/ubuntu-gtsam-python/Dockerfile +++ b/docker/ubuntu-gtsam-python/Dockerfile @@ -1,7 +1,7 @@ # GTSAM Ubuntu image with Python wrapper support. # Get the base Ubuntu/GTSAM image from Docker Hub -FROM dellaert/ubuntu-gtsam:latest +FROM dellaert/ubuntu-gtsam:bionic # Install pip RUN apt-get install -y python3-pip python3-dev @@ -25,7 +25,7 @@ RUN cmake \ RUN make -j4 install && make clean # Needed to run python wrapper: -RUN echo 'export PYTHONPATH=/usr/local/cython/:$PYTHONPATH' >> /root/.bashrc +RUN echo 'export PYTHONPATH=/usr/local/cython/:$PYTHONPATH' >> /root/.bashrc # Run bash CMD ["bash"] diff --git a/docker/ubuntu-gtsam/Dockerfile b/docker/ubuntu-gtsam/Dockerfile index 393443361..187c76314 100644 --- a/docker/ubuntu-gtsam/Dockerfile +++ b/docker/ubuntu-gtsam/Dockerfile @@ -1,10 +1,10 @@ # Ubuntu image with GTSAM installed. Configured with Boost and TBB support. # Get the base Ubuntu image from Docker Hub -FROM dellaert/ubuntu-boost-tbb:latest +FROM dellaert/ubuntu-boost-tbb:bionic # Install git -RUN apt-get update && \ +RUN apt-get update && \ apt-get install -y git # Install compiler @@ -30,7 +30,7 @@ RUN cmake \ RUN make -j4 install && make clean # Needed to link with GTSAM -RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib:LD_LIBRARY_PATH' >> /root/.bashrc +RUN echo 'export LD_LIBRARY_PATH=/usr/local/lib:LD_LIBRARY_PATH' >> /root/.bashrc # Run bash CMD ["bash"] From 17873485db36531a2a360b4bd609139e2c0e7128 Mon Sep 17 00:00:00 2001 From: Jose Luis Blanco Claraco Date: Tue, 14 Jul 2020 23:33:25 +0200 Subject: [PATCH 6/6] complete README --- docker/README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docker/README.md b/docker/README.md index 4dec63b94..0c136f94c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,14 +3,19 @@ Build all docker images, in order: ```bash -(cd ubuntu-boost-tbb && exec build.sh) -(cd ubuntu-gtsam && exec build.sh) -(cd ubuntu-gtsam-python && exec build.sh) -(cd ubuntu-gtsam-python-vnc && exec build.sh) +(cd ubuntu-boost-tbb && ./build.sh) +(cd ubuntu-gtsam && ./build.sh) +(cd ubuntu-gtsam-python && ./build.sh) +(cd ubuntu-gtsam-python-vnc && ./build.sh) ``` Then launch with: - docker run dellaert/ubuntu-gtsam-python-vnc:bionic + docker run -p 5900:5900 dellaert/ubuntu-gtsam-python-vnc:bionic + +Then open a remote VNC X client, for example: + + sudo apt-get install tigervnc-viewer + xtigervncviewer :5900