From 9d2f6ed700e512b2adbcabf4a32b7718f21be414 Mon Sep 17 00:00:00 2001 From: Fortune Iriaye <firiaye@uab.edu> Date: Thu, 21 Nov 2024 10:49:30 -0600 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eda56b6..c567d58 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ default: - image: docker:26.0.1 + image: docker:26.0.1-dind stages: - build @@ -7,30 +7,17 @@ stages: variables: PACKAGE_NAME: "alphafold" DOCKER_IMAGE: "$CI_REGISTRY_IMAGE/$PACKAGE_NAME" - DOCKER_TLS_CERTDIR: "" - DOCKER_HOST: tcp://docker:2375 - DOCKER_DRIVER: overlay2 - DOCKER_BUILDKIT: 1 # Enable BuildKit for efficient builds + DOCKER_TLS_CERTDIR: "/certs" + +before_script: + - unset DOCKER_HOST + - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY push_docker_image: stage: build - 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 + image: docker:26.0.1-dind script: - # 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 build -t $DOCKER_IMAGE:$CI_COMMIT_SHORT_SHA -f docker/Dockerfile . - docker push $DOCKER_IMAGE:$CI_COMMIT_SHORT_SHA only: - - main # Run only on the main branch + - main # Only run on the main branch -- GitLab