diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 31799d8f1cd0d6d6563b137a1ad79615747457cd..85a74b30a95ae953a43dfe4870f0d4f4cdce66e9 100755
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,15 +12,19 @@ variables:
     - changes: 
       - $IMAGE_NAME/Dockerfile
       - basis/*
-  needs:  # if the build_and_push step basis has to be done, then make the other build_and_push steps dependend of it
-    - job: basis
-      optional: true # only run if basis is added to the pipeline (depends on the rules).
   before_script:
     - docker login -u "$DOCKER_HUB_USER" -p $DOCKER_TOKEN
   script:
       - docker build -t "$DOCKER_HUB_USER/etp_$IMAGE_NAME" $IMAGE_NAME/Dockerfile --no-cache;
       - docker push "$DOCKER_HUB_USER/etp_$IMAGE_NAME";
 
+.extend_build_image:
+  extends:
+    - .common_build
+  needs:  # if the build_and_push step basis has to be done, then make the other build_and_push steps dependend of it
+    - job: basis
+      optional: true # only run if basis is added to the pipeline (depends on the rules).
+
 basis:
   variables:
     IMAGE_NAME: "basis"
@@ -31,25 +35,25 @@ tp:
   variables:
     IMAGE_NAME: "tp"
   extends:
-    - .common_build
+    - ..extend_build_image:
 
 python311:
   variables:
     IMAGE_NAME: "python311"
   extends:
-    - .common_build
+    - ..extend_build_image:
 
 basis_jupytermachine:
   variables:
     IMAGE_NAME: "basis_jupytermachine"
   extends:
-    - .common_build
+    - ..extend_build_image:
 
 tp_herwig:
   variables:
     IMAGE_NAME: "tp_herwig"
   extends:
-    - .common_build
+    - ..extend_build_image:
 
 create_jupytermachine_version:
   stage: create_jupytermachine_version
diff --git a/basis/Dockerfile b/basis/Dockerfile
index 93e7ae154a7d7f6111d2bc9e516013dc6eef6534..4696e90cbcf1c83d2cc4b884ecd7e5b4b7f1e85a 100755
--- a/basis/Dockerfile
+++ b/basis/Dockerfile
@@ -24,8 +24,29 @@ RUN apt-get update -y && apt-get upgrade -y && \
 
 
 ### installing pip packages
-RUN pip install numpy seaborn scipy matplotlib uncertainties pyunfold PhyPraKit pandas\
-    kafe2 pydot graphviz scikit-learn jupytext nbgitpuller jupyterlab-git ipympl pyarrow ipywidgets jupyter-server bash_kernel iminuit --upgrade --no-cache-dir
+RUN pip install numpy \
+                matplotlib \
+                scipy \
+                seaborn \
+                uncertainties \
+                pyunfold \
+                PhyPraKit \
+                pandas \
+                kafe2 \
+                pydot \
+                graphviz \
+                scikit-learn \
+                jupytext \
+                nbgitpuller \
+                jupyterlab-git \
+                ipympl \
+                pyarrow \
+                ipywidgets \
+                jupyter-server \
+                bash_kernel \
+                --upgrade --no-cache-dir
+
+RUN pip install iminuit --no-cache-dir
 
 RUN export NBGITPULLER_PARENTPATH=/home/$NB_USER