Fix GitLab CI/CD Docker socket configuration

Remove docker:24-dind service to use runner's mounted Docker socket.
This fixes the 403 Git access error and Docker socket conflict.

Changes:
- Remove services: docker:24-dind from build and deploy jobs
- Change image from docker:24-dind to docker:24
- Update DOCKER_HOST to use unix socket

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-09-27 07:39:48 +01:00
parent 6c05b7d0e8
commit 849d4994de

View File

@ -3,14 +3,11 @@ stages:
- deploy - deploy
variables: variables:
DOCKER_DRIVER: overlay2 DOCKER_HOST: unix:///var/run/docker.sock
DOCKER_TLS_CERTDIR: "/certs"
build: build:
stage: build stage: build
image: docker:24-dind image: docker:24
services:
- docker:24-dind
script: script:
- echo "Building LittleShop Docker image" - echo "Building LittleShop Docker image"
- docker build -t localhost:5000/littleshop:latest . - docker build -t localhost:5000/littleshop:latest .
@ -28,9 +25,7 @@ build:
deploy:vps: deploy:vps:
stage: deploy stage: deploy
image: docker:24-dind image: docker:24
services:
- docker:24-dind
before_script: before_script:
- apk add --no-cache openssh-client bash curl - apk add --no-cache openssh-client bash curl
- echo "$VPS_SSH_KEY_B64" | base64 -d > /tmp/deploy_key - echo "$VPS_SSH_KEY_B64" | base64 -d > /tmp/deploy_key