From 929266c55dd4a35dd50611f06c68bf9f7d4d4a51 Mon Sep 17 00:00:00 2001 From: root <1772105645@qq.com> Date: Fri, 19 Dec 2025 10:18:57 +0800 Subject: [PATCH] Fix: Add image push and comment out deploy stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added docker tag and push commands to push image to private registry - Pushed image will be: 192.168.1.154:31010/file-system-server:latest - Commented out deploy_service stage that requires shell runner - Now CI/CD will successfully build and push image to your registry 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitlab-ci.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 501fdc0..9d7e7ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,21 +17,23 @@ build_image: - apk add --no-cache docker-cli - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG . + - docker tag $DOCKER_IMAGE_NAME:$DOCKER_TAG $CI_REGISTRY/$DOCKER_IMAGE_NAME:$DOCKER_TAG + - docker push $CI_REGISTRY/$DOCKER_IMAGE_NAME:$DOCKER_TAG only: - main -# 部署服务 -deploy_service: - stage: deploy - image: 192.168.1.154:31010/docker/compose:latest - script: - # 停止旧容器(如果存在) - - docker-compose down --remove-orphans || true - # 重新构建并启动服务 - - docker-compose up -d --build - # 清理未使用的镜像 - - docker image prune -f - tags: - - shell # 假设您的 GitLab Runner 是 Shell Executor,可以直接操作宿主机 Docker - only: - - main +# 部署服务(可选,需要配置shell runner) +# deploy_service: +# stage: deploy +# image: 192.168.1.154:31010/docker/compose:latest +# script: +# # 停止旧容器(如果存在) +# - docker-compose down --remove-orphans || true +# # 重新构建并启动服务 +# - docker-compose up -d --build +# # 清理未使用的镜像 +# - docker image prune -f +# tags: +# - shell # 需要配置shell执行器的GitLab Runner +# only: +# - main