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)