Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
FROM ros:melodic

# Update ROS GPG Key
RUN \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

# Disable interactive mode
ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -20,14 +24,29 @@ RUN \
ros-melodic-pcl-ros libopencv-dev ros-melodic-cv-bridge ros-melodic-lanelet2* && \
rm -rf /var/lib/apt/lists/*

# Adding Nvidia Support
ADD NVIDIA-DRIVER.run /tmp/NVIDIA-DRIVER.run
RUN sh /tmp/NVIDIA-DRIVER.run -a -N --ui=none --no-kernel-module
RUN rm /tmp/NVIDIA-DRIVER.run

# Add assuremappingtools binaries into the image
COPY ./bin /assuremappingtools

# Update OpenGL Library
COPY --from=nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 \
/usr/local/lib/x86_64-linux-gnu \
/usr/local/lib/x86_64-linux-gnu

COPY --from=nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 \
/usr/local/share/glvnd/egl_vendor.d/10_nvidia.json \
/usr/local/share/glvnd/egl_vendor.d/10_nvidia.json

RUN echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && \
ldconfig && \
echo '/usr/local/$LIB/libGL.so.1' >> /etc/ld.so.preload && \
echo '/usr/local/$LIB/libEGL.so.1' >> /etc/ld.so.preload

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# Setup the enviroment and startup commands
ENV LD_LIBRARY_PATH=/assuremappingtools/libs:$LD_LIBRARY_PATH
ENV PATH=/assuremappingtools:$PATH
Expand Down
7 changes: 1 addition & 6 deletions build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ set -e
ORG_NAME="zatitech/"
IMAGE_NAME=${ORG_NAME}"assuremappingtools"

# download NVIDIA Driver
version="$(glxinfo | grep "OpenGL version string" | rev | cut -d" " -f1 | rev)"
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/"$version"/NVIDIA-Linux-x86_64-"$version".run
mv NVIDIA-Linux-x86_64-"$version".run NVIDIA-DRIVER.run

# use git to check ifit is master branch tag it as latest after the build
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
branch_name=${branch_name:-HEAD}

echo "Building tagged version ${branch_name}"
docker build -t ${IMAGE_NAME}:${branch_name} .
docker build -t ${IMAGE_NAME}:${branch_name} .
6 changes: 3 additions & 3 deletions run-docker
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ done
if [ -z "$TAG" ]
then
echo "No specific tag provided using 'master'"
TAG=master
TAG=master-hotfix
else
echo "tag specified using '${TAG}'"
fi
Expand All @@ -65,9 +65,9 @@ fi

xhost + && \
docker run -it --rm \
--runtime=nvidia \
--env="DISPLAY=$DISPLAY" \
${ADD_VOLUME} \
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
--device=/dev/dri/card0:/dev/dri/card0 \
--privileged \
zatitech/assuremappingtools:${TAG}
zatitech/assuremappingtools:${TAG}