Skip to content

Commit

Permalink
Add docker build option for reproducibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
drebain committed Jul 1, 2022
1 parent 2f25416 commit 39ad496
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from nvidia/cuda:10.2-devel-ubuntu18.04

env NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display

workdir /viper

run apt-get update --yes
run apt-get install --yes \
g++ \
cmake \
xorg-dev \
libboost-all-dev \
libglew-dev \
libcgal-dev \
libtbb-dev \
libgl1-mesa-glx \
libgl1-mesa-dev \
libgl1-mesa-dri
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ make
./demo
```

### Build & run with Docker
If you do not want to set up an Ubuntu 18.04 environment to build, you may use the provided dockerfile to build and run in a container from a Linux host running X11.

Start by installing `nvidia-docker` following the instructions [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html).

You may then build and run the demo with
```
sudo ./build_run_docker.sh
```

## How to cite this work
```
@conference{angles2019viper,
Expand Down
19 changes: 19 additions & 0 deletions build_run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/sh

nvidia-docker build -t viper-img .

nvidia-docker run --rm --interactive \
--volume "$PWD:/viper" \
viper-img \
./docker_build_entry.sh

XSOCK=/tmp/.X11-unix

nvidia-docker run --rm --interactive \
--volume "$PWD:/viper" \
--workdir /viper/build \
-e DISPLAY=$DISPLAY \
-v $XSOCK:$XSOCK \
-v $HOME/.Xauthority:/root/.Xauthority \
viper-img \
./demo
8 changes: 8 additions & 0 deletions docker_build_entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/sh

if [ ! -d build ]; then
mkdir build
fi
cd build
cmake ..
make

0 comments on commit 39ad496

Please sign in to comment.