From ea4e9683507217f7a590616920e9d22044a24c6c Mon Sep 17 00:00:00 2001 From: RuVT Date: Sat, 25 Apr 2020 12:53:16 -0700 Subject: [PATCH] Adding a Dockerfile to create an image with all the dependencies --- Dockerfile | 13 +++++++++++++ build_and_run.sh | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100644 build_and_run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c5e4f0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:latest +RUN apt-get update +RUN apt install -y python3 +RUN apt install -y python3-pip +RUN apt install -y cmake +RUN apt install -y libsm6 +RUN apt install -y libxext6 +RUN apt install -y libxrender1 +RUN apt install -y libfontconfig1 +RUN pip3 install opencv-python +COPY . /home/GazeTracking +WORKDIR /home/GazeTracking +RUN pip3 install -r requirements.txt diff --git a/build_and_run.sh b/build_and_run.sh new file mode 100644 index 0000000..8e136e8 --- /dev/null +++ b/build_and_run.sh @@ -0,0 +1,12 @@ +IMAGE_NAME=gaze-tracking + +# allow root access to x server +xhost local:root +# build and run docker image +([ "$(docker images -q ${IMAGE_NAME})" == "" ] && docker build -t ${IMAGE_NAME} . ) +([ "$(docker images -q ${IMAGE_NAME})" != "" ] && \ +docker run --rm --device /dev/video0 \ + -e DISPLAY=${DISPLAY} \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + --env="QT_X11_NO_MITSHM=1" \ + -it ${IMAGE_NAME} bash)