From 67ac69a96ddba102f5672a802b3bc15927d86c08 Mon Sep 17 00:00:00 2001
From: Fortune Iriaye <firiaye@uab.edu>
Date: Thu, 21 Nov 2024 08:45:20 -0600
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c567d58..eda56b6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
 default:
-  image: docker:26.0.1-dind
+  image: docker:26.0.1
 
 stages:
   - build
@@ -7,17 +7,30 @@ stages:
 variables:
   PACKAGE_NAME: "alphafold"
   DOCKER_IMAGE: "$CI_REGISTRY_IMAGE/$PACKAGE_NAME"
-  DOCKER_TLS_CERTDIR: "/certs"
-
-before_script:
-  - unset DOCKER_HOST
-  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
+  DOCKER_TLS_CERTDIR: ""
+  DOCKER_HOST: tcp://docker:2375
+  DOCKER_DRIVER: overlay2
+  DOCKER_BUILDKIT: 1  # Enable BuildKit for efficient builds
 
 push_docker_image:
   stage: build
-  image: docker:26.0.1-dind
+  image: docker:26.0.1
+  services:
+    - name: docker:26.0.1-dind
+      alias: docker
+      command:
+        - "--dns=8.8.8.8"
+        - "--dns=8.8.4.4"
+        - "--storage-driver=overlay2"
+        - "--default-ulimit=memlock=-1"
+  before_script:
+    # Use a temporary Docker config directory
+    - export DOCKER_CONFIG=$(mktemp -d)
+    # Securely log in to Docker registry
+    - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
   script:
-    - docker build -t $DOCKER_IMAGE:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile .
+    # Build the Docker image with increased memory and CPU
+    - docker build --memory=8g --cpus=4 -t $DOCKER_IMAGE:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile .
     - docker push $DOCKER_IMAGE:$CI_COMMIT_SHORT_SHA
   only:
-    - main  # Only run on the main branch
+    - main  # Run only on the main branch
-- 
GitLab