From e41cd0c2a98377e481e3d0bd8d97f37dd57fbebd Mon Sep 17 00:00:00 2001
From: Andrews Sobral <andrewssobral@gmail.com>
Date: Sat, 4 Mar 2023 23:12:35 +0100
Subject: [PATCH] Added dockerfiles

---
 dockerfiles/opencv_3.4.16py38/Dockerfile | 35 ++++++++++++++++++++++++
 dockerfiles/opencv_3.4.7py38/Dockerfile  | 35 ++++++++++++++++++++++++
 dockerfiles/opencv_4.6.0py38/Dockerfile  | 35 ++++++++++++++++++++++++
 3 files changed, 105 insertions(+)
 create mode 100644 dockerfiles/opencv_3.4.16py38/Dockerfile
 create mode 100644 dockerfiles/opencv_3.4.7py38/Dockerfile
 create mode 100644 dockerfiles/opencv_4.6.0py38/Dockerfile

diff --git a/dockerfiles/opencv_3.4.16py38/Dockerfile b/dockerfiles/opencv_3.4.16py38/Dockerfile
new file mode 100644
index 0000000..bc7a454
--- /dev/null
+++ b/dockerfiles/opencv_3.4.16py38/Dockerfile
@@ -0,0 +1,35 @@
+# docker build --build-arg INCUBATOR_VER=$(date +%Y%m%d-%H%M%S) -t andrewssobral/bgslibrary:opencv_3.4.16py38 .
+# docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY andrewssobral/bgslibrary:opencv_3.4.16py38 bash
+FROM andrewssobral/opencv3:3.4.16
+
+WORKDIR /opt
+
+# Changing INCUBATOR_VER will break the cache here
+ARG INCUBATOR_VER=unknown
+
+RUN git clone --recursive https://github.com/andrewssobral/bgslibrary.git
+ENV BGSLIBRARY_HOME=$PWD/bgslibrary
+
+# Compile C++ library
+WORKDIR /opt/bgslibrary/build
+RUN cmake .. && make -j4 && make install
+ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
+
+# Build and install the python wrapper
+WORKDIR /opt/bgslibrary
+RUN python setup.py build
+RUN python setup.py install
+ENV PYTHONPATH=$PYTHONPATH:/opt/bgslibrary/build/lib.linux-x86_64-cpython-38
+
+# Compile the C++ QT User Interface
+WORKDIR /opt/bgslibrary/gui/qt/build
+RUN cmake .. && make -j4
+RUN cp bgslibrary_gui ../../..
+
+# Compile examples
+WORKDIR /opt/bgslibrary/examples/build
+RUN cmake .. && make -j4
+
+# Turn all shell scripts executable
+WORKDIR /opt/bgslibrary
+RUN chmod +x *.sh
diff --git a/dockerfiles/opencv_3.4.7py38/Dockerfile b/dockerfiles/opencv_3.4.7py38/Dockerfile
new file mode 100644
index 0000000..a453958
--- /dev/null
+++ b/dockerfiles/opencv_3.4.7py38/Dockerfile
@@ -0,0 +1,35 @@
+# docker build --build-arg INCUBATOR_VER=$(date +%Y%m%d-%H%M%S) -t andrewssobral/bgslibrary:opencv_3.4.7py38 .
+# docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY andrewssobral/bgslibrary:opencv_3.4.7py38 bash
+FROM andrewssobral/opencv3:3.4.7
+
+WORKDIR /opt
+
+# Changing INCUBATOR_VER will break the cache here
+ARG INCUBATOR_VER=unknown
+
+RUN git clone --recursive https://github.com/andrewssobral/bgslibrary.git
+ENV BGSLIBRARY_HOME=$PWD/bgslibrary
+
+# Compile C++ library
+WORKDIR /opt/bgslibrary/build
+RUN cmake .. && make -j4 && make install
+ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
+
+# Build and install the python wrapper
+WORKDIR /opt/bgslibrary
+RUN python setup.py build
+RUN python setup.py install
+ENV PYTHONPATH=$PYTHONPATH:/opt/bgslibrary/build/lib.linux-x86_64-cpython-38
+
+# Compile the C++ QT User Interface
+WORKDIR /opt/bgslibrary/gui/qt/build
+RUN cmake .. && make -j4
+RUN cp bgslibrary_gui ../../..
+
+# Compile examples
+WORKDIR /opt/bgslibrary/examples/build
+RUN cmake .. && make -j4
+
+# Turn all shell scripts executable
+WORKDIR /opt/bgslibrary
+RUN chmod +x *.sh
diff --git a/dockerfiles/opencv_4.6.0py38/Dockerfile b/dockerfiles/opencv_4.6.0py38/Dockerfile
new file mode 100644
index 0000000..bff6cee
--- /dev/null
+++ b/dockerfiles/opencv_4.6.0py38/Dockerfile
@@ -0,0 +1,35 @@
+# docker build --build-arg INCUBATOR_VER=$(date +%Y%m%d-%H%M%S) -t andrewssobral/bgslibrary:opencv_4.6.0py38 .
+# docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY andrewssobral/bgslibrary:opencv_4.6.0py38 bash
+FROM andrewssobral/opencv4:4.6.0
+
+WORKDIR /opt
+
+# Changing INCUBATOR_VER will break the cache here
+ARG INCUBATOR_VER=unknown
+
+RUN git clone --recursive https://github.com/andrewssobral/bgslibrary.git
+ENV BGSLIBRARY_HOME=$PWD/bgslibrary
+
+# Compile C++ library
+WORKDIR /opt/bgslibrary/build
+RUN cmake .. && make -j4 && make install
+ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
+
+# Build and install the python wrapper
+WORKDIR /opt/bgslibrary
+RUN python setup.py build
+RUN python setup.py install
+ENV PYTHONPATH=$PYTHONPATH:/opt/bgslibrary/build/lib.linux-x86_64-cpython-38
+
+# Compile the C++ QT User Interface
+WORKDIR /opt/bgslibrary/gui/qt/build
+RUN cmake .. && make -j4
+RUN cp bgslibrary_gui ../../..
+
+# Compile examples
+WORKDIR /opt/bgslibrary/examples/build
+RUN cmake .. && make -j4
+
+# Turn all shell scripts executable
+WORKDIR /opt/bgslibrary
+RUN chmod +x *.sh
-- 
GitLab