Compare commits

...

3 Commits

Author SHA1 Message Date
siujamo bd2748e25c fix: disable provenance in docker build to fix GitLab Registry 0B display
Add `--provenance=false` flag to `docker build` command. This stops Docker BuildKit
from generating OCI Referrers/attestations, which are not correctly parsed by GitLab
Container Registry and cause the UI to display 0B size and "missing manifest digest" errors.
2026-05-25 13:58:14 +08:00
siujamo 0f1093774f fix: use GitLab predefined environment variables for container registry
Replace custom registry variables with GitLab's predefined CI_REGISTRY,
CI_REGISTRY_IMAGE, and CI_REGISTRY_USER to ensure the built-in CI_JOB_TOKEN
has correct push permissions.
2026-05-25 11:47:22 +08:00
siujamo d19b7f5563 fix: allow jar files to be copied in Docker build context
Add '!build/libs/*.jar' to .dockerignore so that Docker build can access the build
artifacts in the package stage.
2026-05-25 11:05:25 +08:00
2 changed files with 9 additions and 8 deletions
+2
View File
@@ -1,4 +1,6 @@
delta-force-guide-server.iml
build/
!.gitlab-ci.yml
!build/libs/*.jar
.idea/
.gradle
+7 -8
View File
@@ -1,6 +1,4 @@
variables:
REGISTRY: registry.onixbyte.cn
IMAGE_NAME: delta-force-guide
GRADLE_OPTS: -Dorg.gradle.daemon=false
DOCKER_HOST: unix:///var/run/docker.sock
@@ -37,11 +35,12 @@ package:
- JAR_FILE=$(find build/libs -name '*.jar' | head -1)
- echo "Building Docker image for tag $CI_COMMIT_TAG with JAR $JAR_FILE"
- docker build
--provenance=false
-f Dockerfile.ci
--build-arg JAR_FILE="$JAR_FILE"
-t "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG"
-t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
.
- docker tag "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG" "$REGISTRY/$IMAGE_NAME:latest"
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
rules:
- if: $CI_COMMIT_TAG
@@ -51,9 +50,9 @@ deploy:
needs:
- package
script:
- echo "Pushing image $REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG"
- docker login "$REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$REGISTRY/$IMAGE_NAME:$CI_COMMIT_TAG"
- docker push "$REGISTRY/$IMAGE_NAME:latest"
- echo "Pushing image $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker push "$CI_REGISTRY_IMAGE:latest"
rules:
- if: $CI_COMMIT_TAG