diff --git a/Dockerfile b/Dockerfile
index 1ef1b9e9..e05a00ea 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@
 # ==================================
 # Use an official Python runtime as a parent image
 FROM python:3.9-slim
-RUN apt-get update && apt-get -y install libglib2.0-0; apt-get clean
+RUN apt-get update && apt-get -y install libgl1-mesa-dev libglib2.0-0; apt-get clean
 RUN pip install opencv-contrib-python-headless
 
 # Set environment variables
diff --git a/tests/Dockerfile b/tests/Dockerfile
index f6e46515..e28fbc8e 100644
--- a/tests/Dockerfile
+++ b/tests/Dockerfile
@@ -2,6 +2,8 @@
 # -==================
 # Use an official Python runtime as a parent image
 FROM python:3.9-slim
+RUN apt-get update && apt-get -y install libgl1-mesa-dev libglib2.0-0; apt-get clean
+RUN pip install opencv-contrib-python-headless
 
 # Set environment variables to make Python output unbuffered and disable the PIP cache
 ENV PYTHONDONTWRITEBYTECODE 1