From ee4101bf1264eab3e36484f25cbffe7aef955fc9 Mon Sep 17 00:00:00 2001 From: francois Date: Sat, 3 Feb 2024 17:37:44 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb25aec..49f1c86 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,20 +19,21 @@ build-push-docker-image-job: script: - echo "Building..." # MAKE SURE NO SPACE ON EITHER SIDE OF = IN THE FOLLOWING LINE - export CONTAINER_FULL_IMAGE_NAME_WITH_TAG=$IMAGE_NAME_WITH_REGISTRY_PREFIX/my-build-image:$COMMIT_HASH - - docker build -f ./Dockerfile --pull -t built-image-name . + - docker build --network=host -f ./Dockerfile --pull -t built-image-name . - docker tag built-image-name "$CONTAINER_FULL_IMAGE_NAME_WITH_TAG" - docker push "$CONTAINER_FULL_IMAGE_NAME_WITH_TAG" - echo "$CONTAINER_FULL_IMAGE_NAME_WITH_TAG" - echo "Deploying on CapRover..." - - docker run caprover/cli-caprover:2.2.3 caprover deploy --caproverUrl "$CAPROVER_URL" --caproverPassword "$CAPROVER_PASSWORD" -a "$CAPROVER_APP" -i "$CONTAINER_FULL_IMAGE_NAME_WITH_TAG" + - docker run --network=host caprover/cli-caprover:2.2.3 caprover deploy --caproverUrl "$CAPROVER_URL" --caproverPassword "$CAPROVER_PASSWORD" -a "$CAPROVER_APP" -i "$CONTAINER_FULL_IMAGE_NAME_WITH_TAG" only: - main variables: DOCKER_REGISTRY_USER: ${CI_REGISTRY_USER} DOCKER_REGISTRY_PASSWORD: ${CI_REGISTRY_PASSWORD} DOCKER_REGISTRY_URL: ${CI_REGISTRY} + DOCKER_DRIVER: overlay IMAGE_NAME_WITH_REGISTRY_PREFIX: ${CI_REGISTRY_IMAGE} COMMIT_HASH: ${CI_COMMIT_SHA} CAPROVER_URL: ${CAPROVER_URL} CAPROVER_PASSWORD: ${CAPROVER_PASSWORD} - CAPROVER_APP: ${CAPROVER_APP} \ No newline at end of file + CAPROVER_APP: ${CAPROVER_APP}