diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0bdb692a6bc0dfc1466d58c885f3544752f551b..ff16431f2af3d03cdc9de30db02d4f8a98133d21 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -144,12 +144,15 @@ docker-bench-security:
     - "sed -i -e 's/external: true/external: false/g' $MODIFIED_IMAGE/docker-compose.yml"
     - cat $MODIFIED_IMAGE/docker-compose.yml
     - cd $MODIFIED_IMAGE
+    # Login on the production registry, in case there is another image in Docker Compose stored on the production registry
+    - docker logout $REGISTRY
+    - echo $REGISTRY_PROD_PASSWORD | docker login $REGISTRY_PROD -u $REGISTRY_PROD_USERNAME --password-stdin
     - docker-compose up -d
     - git clone https://github.com/docker/docker-bench-security.git
     - cd docker-bench-security
     - sh docker-bench-security.sh -c container_images,container_runtime,docker_security_operations,community_checks -l ../../report.txt
   after_script:
-    - docker logout $REGISTRY
+    - docker logout $REGISTRY_PROD
   artifacts:
     paths:
       - report.txt